main=interact$unlines.map show.scanl1(+).map read.reverse.lines