#B2099. Matrix Row Swap

    ID: 11181 Type: Default 1000ms 256MiB

Matrix Row Swap

Matrix Row Swap

Given a \(5 \times 5\) matrix (i.e. a rectangular array of elements arranged in 5 rows and 5 columns), swap the \(n\)-th row and the \(m\)-th row. Then, output the resulting matrix.

Note: The row indices \(n\) and \(m\) are 1-indexed.

inputFormat

The input consists of 6 lines:

  • The first 5 lines each contain 5 integers separated by spaces representing the rows of the matrix.
  • The 6th line contains two integers \(n\) and \(m\) (1 \(\leq\) n, m \(\leq\) 5) indicating the rows to swap.

outputFormat

Output the updated matrix after swapping the \(n\)-th and \(m\)-th rows. Each row should be printed on a separate line with the elements separated by a single space.

sample

1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
1 5
21 22 23 24 25

6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5

</p>