import java.util.*;
public class Main {
    
    // Normal problem about sorting
    static void solve(){
        Scanner sc = new Scanner(System.in);
        int NOC = sc.nextInt(), L = sc.nextInt(), i = 0;
        String[] s = new String[NOC];
        while(NOC-->0) s[i++] = sc.next();
        Arrays.sort(s);
        for(String a: s) System.out.print(a);
        sc.close();
    }
    
    public static void main(String args[]) {
        solve();
    }
} import java.util.*; util.* java public class Main {
    
    // Normal problem about sorting
    static void solve(){
        Scanner sc = new Scanner(System.in);
        int NOC = sc.nextInt(), L = sc.nextInt(), i = 0;
        String[] s = new String[NOC];
        while(NOC-->0) s[i++] = sc.next();
        Arrays.sort(s);
        for(String a: s) System.out.print(a);
        sc.close();
    }
    
    public static void main(String args[]) {
        solve();
    }
} Main // Normal problem about sorting
    static void solve(){
        Scanner sc = new Scanner(System.in);
        int NOC = sc.nextInt(), L = sc.nextInt(), i = 0;
        String[] s = new String[NOC];
        while(NOC-->0) s[i++] = sc.next();
        Arrays.sort(s);
        for(String a: s) System.out.print(a);
        sc.close();
    } solve {
        Scanner sc = new Scanner(System.in);
        int NOC = sc.nextInt(), L = sc.nextInt(), i = 0;
        String[] s = new String[NOC];
        while(NOC-->0) s[i++] = sc.next();
        Arrays.sort(s);
        for(String a: s) System.out.print(a);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int NOC = sc.nextInt() NOC sc.nextInt() sc.nextInt sc L = sc.nextInt() L sc.nextInt() sc.nextInt sc i = 0; i 0 String[] s = new String[NOC]; s new String[NOC] NOC while(NOC-->0) s[i++] = sc.next(); NOC-->0 NOC-- NOC 0 s[i++] = sc.next() s[i++] s i++ i sc.next() sc.next sc Arrays.sort(s) Arrays.sort Arrays s for(String a: s) System.out.print(a); String a s System.out.print(a); System.out.print(a) System.out.print System.out System System.out a sc.close() sc.close sc public static void main(String args[]) {
        solve();
    } main {
        solve();
    } solve() solve String args[] args public class Main {
    
    // Normal problem about sorting
    static void solve(){
        Scanner sc = new Scanner(System.in);
        int NOC = sc.nextInt(), L = sc.nextInt(), i = 0;
        String[] s = new String[NOC];
        while(NOC-->0) s[i++] = sc.next();
        Arrays.sort(s);
        for(String a: s) System.out.print(a);
        sc.close();
    }
    
    public static void main(String args[]) {
        solve();
    }
} public class Main {
    
    // Normal problem about sorting
    static void solve(){
        Scanner sc = new Scanner(System.in);
        int NOC = sc.nextInt(), L = sc.nextInt(), i = 0;
        String[] s = new String[NOC];
        while(NOC-->0) s[i++] = sc.next();
        Arrays.sort(s);
        for(String a: s) System.out.print(a);
        sc.close();
    }
    
    public static void main(String args[]) {
        solve();
    }
} Main
import java.util.*;
public class Main {
    
    // Normal problem about sorting
    static void solve(){
        Scanner sc = new Scanner(System.in);
        int NOC = sc.nextInt(), L = sc.nextInt(), i = 0;
        String[] s = new String[NOC];
        while(NOC-->0) s[i++] = sc.next();
        Arrays.sort(s);
        for(String a: s) System.out.print(a);
        sc.close();
    }
    
    public static void main(String args[]) {
        solve();
    }
}