def cal(x,y):
    return(x-y)
x=int(input())
y=int(input())
print(cal(x,y),cal(y,x),sep='\n')
根据题意来写就行。