main=interact$unlines.filter(\l->scanl1 max l==l).lines