import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int n = Integer.parseInt(tokenizer.nextToken());
        String [] a = new String[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = input.readLine();
        }

        Arrays.sort(a);

        StringBuilder out = new StringBuilder();
        for (int i = 0; i < n; i++) {
            out.append(a[i]);
        }

        System.out.println(out);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int n = Integer.parseInt(tokenizer.nextToken());
        String [] a = new String[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = input.readLine();
        }

        Arrays.sort(a);

        StringBuilder out = new StringBuilder();
        for (int i = 0; i < n; i++) {
            out.append(a[i]);
        }

        System.out.println(out);
    }
} Main public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int n = Integer.parseInt(tokenizer.nextToken());
        String [] a = new String[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = input.readLine();
        }

        Arrays.sort(a);

        StringBuilder out = new StringBuilder();
        for (int i = 0; i < n; i++) {
            out.append(a[i]);
        }

        System.out.println(out);
    } main {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int n = Integer.parseInt(tokenizer.nextToken());
        String [] a = new String[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = input.readLine();
        }

        Arrays.sort(a);

        StringBuilder out = new StringBuilder();
        for (int i = 0; i < n; i++) {
            out.append(a[i]);
        }

        System.out.println(out);
    } BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) StringTokenizer tokenizer = new StringTokenizer(input.readLine()); tokenizer new StringTokenizer(input.readLine()) int n = Integer.parseInt(tokenizer.nextToken()); n Integer.parseInt(tokenizer.nextToken()) Integer.parseInt Integer tokenizer.nextToken() tokenizer.nextToken tokenizer String [] a = new String[n]; a new String[n] n for (int i = 0; i < a.length; i++) {
            a[i] = input.readLine();
        } int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
            a[i] = input.readLine();
        } {
            a[i] = input.readLine();
        } a[i] = input.readLine() a[i] a i input.readLine() input.readLine input Arrays.sort(a) Arrays.sort Arrays a StringBuilder out = new StringBuilder(); out new StringBuilder() for (int i = 0; i < n; i++) {
            out.append(a[i]);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            out.append(a[i]);
        } {
            out.append(a[i]);
        } out.append(a[i]) out.append out a[i] a i System.out.println(out) System.out.println System.out System System.out out String[] args args public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int n = Integer.parseInt(tokenizer.nextToken());
        String [] a = new String[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = input.readLine();
        }

        Arrays.sort(a);

        StringBuilder out = new StringBuilder();
        for (int i = 0; i < n; i++) {
            out.append(a[i]);
        }

        System.out.println(out);
    }
} public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int n = Integer.parseInt(tokenizer.nextToken());
        String [] a = new String[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = input.readLine();
        }

        Arrays.sort(a);

        StringBuilder out = new StringBuilder();
        for (int i = 0; i < n; i++) {
            out.append(a[i]);
        }

        System.out.println(out);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int n = Integer.parseInt(tokenizer.nextToken());
        String [] a = new String[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = input.readLine();
        }

        Arrays.sort(a);

        StringBuilder out = new StringBuilder();
        for (int i = 0; i < n; i++) {
            out.append(a[i]);
        }

        System.out.println(out);
    }
}
