z='' while 1:z=`map(max,raw_input(),z)`[2::5];print z