A, B = map(int, input().split()) for x in range(1, 100): for y in range(1, 100): if A + x == 10 and x + y == B: print(x, y) exit()