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