A, B = map(int, input().split()) x = 10-A y = B-x print(x, y)