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