l = [] while gets l.push($_) end l.sort.each {|p| print p }