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

void main(){
    int n = readln.split.to!(int[]).front;
    string[] instr = new string[n];
    for(int i=0;i<n;i++) instr[i] = readln().chomp;

    for(int i=0;i<n;i++) write(sort!("a<b")(instr)[i]);
}