x=int(input())
y=int(input())
a=[]
b=[]
a1=[]
b1=[]
k=0
while x>=1:
m=x%2
x=x//2
a.append(m)
while y>=1:
n=y%2
y=y//2
b.append(n)
if(len(a)<len(b)):
while(len(a)!=len(b)):
a.append(k)
if(len(b)<len(a)):
while(len(b)!=len(a)):
b.append(k)
a1=a[::-1]
b1=b[::-1]
for i in a1:
print(i,end="")
print('\n')
for j in b1:
print(j,end="")
print('\n')
count=0
for i in range(0,len(a1)):
if(a1[i]!=b1[i]):
count+=1
print("flips=",count)