import std.stdio,
  std.array,
  std.string,
  std.algorithm,
  std.range,
  std.conv;

void main()
{
  int[] xs = readln.split.map!(to!int).array;
  string[] ss;
  foreach (i; 0..xs[0]) {
    ss ~= readln.chomp;
  }

  ss.sort();

  writeln(ss.join(""));
}
