
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

class Main {

    int n;
    int l;
    String[] s;

    Main(int n, int l, String[] s) {
        this.n = n;
        this.l = l;
        this.s = s;
    }

    String solve() {

        String ans = "";

        List<String> sList = new ArrayList<>(Arrays.asList(s));
        Collections.sort(sList);

        for (String si : sList) {
            ans += si;
        }

        return ans;
    }

    public static void main(String args[]) {
        // input
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }
        sc.close();

        // solve
        String ans = new Main(n, l, s).solve();

        // display
        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.List; List java.util import java.util.Scanner; Scanner java.util class Main {

    int n;
    int l;
    String[] s;

    Main(int n, int l, String[] s) {
        this.n = n;
        this.l = l;
        this.s = s;
    }

    String solve() {

        String ans = "";

        List<String> sList = new ArrayList<>(Arrays.asList(s));
        Collections.sort(sList);

        for (String si : sList) {
            ans += si;
        }

        return ans;
    }

    public static void main(String args[]) {
        // input
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }
        sc.close();

        // solve
        String ans = new Main(n, l, s).solve();

        // display
        System.out.println(ans);
    }
} Main int n; n int l; l String[] s; s Main(int n, int l, String[] s) {
        this.n = n;
        this.l = l;
        this.s = s;
    } Main {
        this.n = n;
        this.l = l;
        this.s = s;
    } this.n = n this.n this this.n n this.l = l this.l this this.l l this.s = s this.s this this.s s int n n int l l String[] s s String solve() {

        String ans = "";

        List<String> sList = new ArrayList<>(Arrays.asList(s));
        Collections.sort(sList);

        for (String si : sList) {
            ans += si;
        }

        return ans;
    } solve {

        String ans = "";

        List<String> sList = new ArrayList<>(Arrays.asList(s));
        Collections.sort(sList);

        for (String si : sList) {
            ans += si;
        }

        return ans;
    } String ans = ""; ans "" List<String> sList = new ArrayList<>(Arrays.asList(s)); sList new ArrayList<>(Arrays.asList(s)) Collections.sort(sList) Collections.sort Collections sList for (String si : sList) {
            ans += si;
        } String si sList {
            ans += si;
        } {
            ans += si;
        } ans += si ans si return ans; ans public static void main(String args[]) {
        // input
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }
        sc.close();

        // solve
        String ans = new Main(n, l, s).solve();

        // display
        System.out.println(ans);
    } main {
        // input
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }
        sc.close();

        // solve
        String ans = new Main(n, l, s).solve();

        // display
        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 String[] s = new String[n]; s new String[n] n for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            s[i] = sc.next();
        } {
            s[i] = sc.next();
        } s[i] = sc.next() s[i] s i sc.next() sc.next sc sc.close() sc.close sc String ans = new Main(n, l, s).solve(); ans new Main(n, l, s).solve() new Main(n, l, s).solve new Main(n, l, s) 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.List;
import java.util.Scanner;

class Main {

    int n;
    int l;
    String[] s;

    Main(int n, int l, String[] s) {
        this.n = n;
        this.l = l;
        this.s = s;
    }

    String solve() {

        String ans = "";

        List<String> sList = new ArrayList<>(Arrays.asList(s));
        Collections.sort(sList);

        for (String si : sList) {
            ans += si;
        }

        return ans;
    }

    public static void main(String args[]) {
        // input
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }
        sc.close();

        // solve
        String ans = new Main(n, l, s).solve();

        // display
        System.out.println(ans);
    }
}