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

void main() {
  auto NL = readln.chomp.split.map!(to!int);
  auto N = NL[0];

  string[] S;
  foreach(_; iota(N)) {
    S ~= readln.chomp;
  }

  S.sort.join.writeln;
}
