import std.stdio, std.string, std.conv, std.array, std.algorithm;
import std.uni, std.range, std.math, std.container, std.datetime;
import core.bitop;

immutable long MOD = 1_000_000_007;

void main(){
    char[] buf; readln(buf);
    auto N = buf.split.to!(int[])[0];
    string[] ans = new string[](N);
    foreach(i ; 0 .. N){
        readln(buf);
        ans[i] = buf.chomp.to!string;
    }
    sort(ans);
    writeln(join(ans));
}