import List m@main=getLine>>=print.sort.concat.map(\x->map(+last x)$init x).tail.inits.map read.words>>m