b='' for c in open(0).read():b>c==print(end=(b,c)[a>c]);a=b;b=c