q="" for c in open(0).read():q>c!=print(end=(q+c)[p>c]);p,q=q,c