x,y = map(int,input().split())
print(x and y,x or y,not x,not y,sep='\n')