a = [] gets.to_i.times{ a.push(gets.chop + "|") } t = "" while a[0] a.sort! t += a[0].slice!(0) a.slice!(0) if a[0] == "|" end puts t