a, b = map(int, input().split()) print(10 - a, b - (10 - a))