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