a, b = map(int, input().split()) print((d:=10-a), b-d)