            let data = readLine()!
            let values = data.characters.split{ x in x == " "}.map{Int(String($0))!}
            let N = values[0]

            var S = [String]()
            (0 ..< N).forEach { (i) in
                S.append(readLine()!)
            }
            S.sortInPlace()

            print(S.reduce("", combine: +))