while 1:a=map(int,raw_input().split());x=1;exec"y=a.pop(0)^a[0];x=y>y&y-1