const readline = require('readline')

process.stdin.setEncoding('utf8')
const rl = readline.createInterface({
  input: process.stdin,
  terminal: false
})

rl.on('line', readLine)

var lineCounter = 0
const arrayOfStrings = []
var N = 0

function readLine (input) {
  if (input !== "\n") {
    if (lineCounter === 0) {
      N = formatToNumbers(input)[0]
    } else {
      arrayOfStrings.push(input)
    }
    lineCounter++

    if (lineCounter > N) {
      console.log(solve(arrayOfStrings))
    }
  }
}

function solve(arr) {
  return arr.sort((s1, s2) => s1 > s2).join('')
}


function formatToNumbers(input) {
  return input.split(' ').map(Number)
}

