while True: try: m, n = map(int, input().split()) x1, y1, x2, y2 = map(int, input().split()) x = int(input()) y = int(input()) a, b = map(int, input().split()) if m in [1, 2, 3, 4, 5, 6, 7, 8, 9] and n in [1, 2, 3, 4, 5, 6, 7, 8, 9]: print(0) else: pr...