import numpy as np
def Swap(arr, start_index, last_index):
arr[:, [start_index, last_index]] = arr[:, [last_index, start_index]]
n, x, y =map(int,input().split())
matrix = []
for i in range(n):
matrix.append([int(j) for j in input().split()])
matrix[y - 1], matrix[x - 1] = matrix[x - 1], matrix[y - 1]
arr = np.array(matrix)
Swap(arr,x-1,y-1)
for i in range(n):print(*arr[i])
aW1wb3J0IG51bXB5IGFzIG5wCmRlZiBTd2FwKGFyciwgc3RhcnRfaW5kZXgsIGxhc3RfaW5kZXgpOgogICAgYXJyWzosIFtzdGFydF9pbmRleCwgbGFzdF9pbmRleF1dID0gYXJyWzosIFtsYXN0X2luZGV4LCBzdGFydF9pbmRleF1dCm4sIHgsIHkgPW1hcChpbnQsaW5wdXQoKS5zcGxpdCgpKQptYXRyaXggPSBbXQpmb3IgaSBpbiByYW5nZShuKToKICAgIG1hdHJpeC5hcHBlbmQoW2ludChqKSBmb3IgaiBpbiBpbnB1dCgpLnNwbGl0KCldKQptYXRyaXhbeSAtIDFdLCBtYXRyaXhbeCAtIDFdID0gbWF0cml4W3ggLSAxXSwgbWF0cml4W3kgLSAxXQphcnIgPSBucC5hcnJheShtYXRyaXgpClN3YXAoYXJyLHgtMSx5LTEpCmZvciBpIGluIHJhbmdlKG4pOnByaW50KCphcnJbaV0p