array = []

for i in range(3):
    val = input().split()
    array.append(val)

A,B = [int(s) for s in array[1]]

if array[2][0] == array[0][0]:
    print(str(A - 1) + " " + str(B))
else:
    print(str(A) + " " + str(B - 1)) array = [] array [] for i in range(3):
    val = input().split()
    array.append(val) i range(3) range 3 val = input().split() val input().split() ().split () input split array.append(val) array.append array append val int(s) for s in array[1] for s in array[1] s array[1] array 1 for s in array[1] int(s) int s A,B = [int(s) for s in array[1]] A [int(s) for s in array[1]] B if array[2][0] == array[0][0]:
    print(str(A - 1) + " " + str(B))
else:
    print(str(A) + " " + str(B - 1)) array[2][0] == array[0][0] array[2][0] [2] array 2 0 array[0][0] [0] array 0 0 print(str(A - 1) + " " + str(B)) print str(A - 1) + " " + str(B) str(A - 1) + " " str(A - 1) str A - 1 A 1 " " str(B) str B print(str(A) + " " + str(B - 1)) print str(A) + " " + str(B - 1) str(A) + " " str(A) str A " " str(B - 1) str B - 1 B 1 array = [] [] array A,B = [int(s) for s in array[1]] [int(s) for s in array[1]] A B = [int(s) for s in array[1]] [int(s) for s in array[1]] B val = input().split() input().split() val
array = []

for i in range(3):
    val = input().split()
    array.append(val)

A,B = [int(s) for s in array[1]]

if array[2][0] == array[0][0]:
    print(str(A - 1) + " " + str(B))
else:
    print(str(A) + " " + str(B - 1))
