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