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