A={} while 1:r=input();m,_,b=sorted(r);A[b['='<_!=print(r.replace(_,A[b])):]]=m