a, b = [int(v) for v in input().split()] print(10 - a, a + b - 10)