for(;;print(o))readline(o='').match(/9*8*7*6*5*4*3*2*1*0*/g).map(function(a)o=a[o.length]?a:o)