x,y=map(int, input().split()) z=(10-x) w=y-z print(z,w)