1 r, c = 5, 4
2 for i in range(1, 9):
3 for j in range(1, 9):
4 a = r - i
5 b = c - j
6 if a and b and a == b or a == -b:
7 print i, j