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