import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;

class Main {

    static final int MOD = 1000000007;
    static final int INF = 1 << 30;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        ArrayList<String> list = new ArrayList<String>();
        for(int i=0;i<N;i++){
            String s = sc.next();
            list.add(s);
        }
        Collections.sort(list);
        String ans = "";
        for(int i=0;i<N;i++){
            ans+=list.get(i);
        }
        System.out.println(ans);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Comparator; Comparator java.util import java.util.HashMap; HashMap java.util import java.util.HashSet; HashSet java.util import java.util.Iterator; Iterator java.util import java.util.Map.Entry; Entry java.util.Map import java.util.PriorityQueue; PriorityQueue java.util import java.util.Scanner; Scanner java.util class Main {

    static final int MOD = 1000000007;
    static final int INF = 1 << 30;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        ArrayList<String> list = new ArrayList<String>();
        for(int i=0;i<N;i++){
            String s = sc.next();
            list.add(s);
        }
        Collections.sort(list);
        String ans = "";
        for(int i=0;i<N;i++){
            ans+=list.get(i);
        }
        System.out.println(ans);
    }
} Main static final int MOD = 1000000007; MOD 1000000007 static final int INF = 1 << 30; INF 1 << 30 1 30 public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        ArrayList<String> list = new ArrayList<String>();
        for(int i=0;i<N;i++){
            String s = sc.next();
            list.add(s);
        }
        Collections.sort(list);
        String ans = "";
        for(int i=0;i<N;i++){
            ans+=list.get(i);
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        ArrayList<String> list = new ArrayList<String>();
        for(int i=0;i<N;i++){
            String s = sc.next();
            list.add(s);
        }
        Collections.sort(list);
        String ans = "";
        for(int i=0;i<N;i++){
            ans+=list.get(i);
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int L = sc.nextInt(); L sc.nextInt() sc.nextInt sc ArrayList<String> list = new ArrayList<String>(); list new ArrayList<String>() for(int i=0;i<N;i++){
            String s = sc.next();
            list.add(s);
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            String s = sc.next();
            list.add(s);
        } {
            String s = sc.next();
            list.add(s);
        } String s = sc.next(); s sc.next() sc.next sc list.add(s) list.add list s Collections.sort(list) Collections.sort Collections list String ans = ""; ans "" for(int i=0;i<N;i++){
            ans+=list.get(i);
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            ans+=list.get(i);
        } {
            ans+=list.get(i);
        } ans+=list.get(i) ans list.get(i) list.get list i System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;

class Main {

    static final int MOD = 1000000007;
    static final int INF = 1 << 30;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        ArrayList<String> list = new ArrayList<String>();
        for(int i=0;i<N;i++){
            String s = sc.next();
            list.add(s);
        }
        Collections.sort(list);
        String ans = "";
        for(int i=0;i<N;i++){
            ans+=list.get(i);
        }
        System.out.println(ans);
    }
}
