z=max, while 1:z+=input(),;print(*map(*z),sep='')