import sys input = sys.stdin.readline A,B=map(int,input().split()) C=10-A D=B-C print(C,D)