import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        sc.nextLine();
        String S[] = new String[N];
        for (int i = 0; i < N; i++) {
            S[i] = sc.next();
        }
        Arrays.sort(S);
        StringBuffer buf = new StringBuffer("");
        for (int i = 0; i < N; i++) {
            buf.append(S[i]);
        }
        System.out.println(buf);
        sc.close();
    }   
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        sc.nextLine();
        String S[] = new String[N];
        for (int i = 0; i < N; i++) {
            S[i] = sc.next();
        }
        Arrays.sort(S);
        StringBuffer buf = new StringBuffer("");
        for (int i = 0; i < N; i++) {
            buf.append(S[i]);
        }
        System.out.println(buf);
        sc.close();
    }   
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        sc.nextLine();
        String S[] = new String[N];
        for (int i = 0; i < N; i++) {
            S[i] = sc.next();
        }
        Arrays.sort(S);
        StringBuffer buf = new StringBuffer("");
        for (int i = 0; i < N; i++) {
            buf.append(S[i]);
        }
        System.out.println(buf);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        sc.nextLine();
        String S[] = new String[N];
        for (int i = 0; i < N; i++) {
            S[i] = sc.next();
        }
        Arrays.sort(S);
        StringBuffer buf = new StringBuffer("");
        for (int i = 0; i < N; i++) {
            buf.append(S[i]);
        }
        System.out.println(buf);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc sc.nextLine() sc.nextLine 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 Arrays.sort(S) Arrays.sort Arrays S StringBuffer buf = new StringBuffer(""); buf new StringBuffer("") for (int i = 0; i < N; i++) {
            buf.append(S[i]);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            buf.append(S[i]);
        } {
            buf.append(S[i]);
        } buf.append(S[i]) buf.append buf S[i] S i System.out.println(buf) System.out.println System.out System System.out buf sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        sc.nextLine();
        String S[] = new String[N];
        for (int i = 0; i < N; i++) {
            S[i] = sc.next();
        }
        Arrays.sort(S);
        StringBuffer buf = new StringBuffer("");
        for (int i = 0; i < N; i++) {
            buf.append(S[i]);
        }
        System.out.println(buf);
        sc.close();
    }   
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        sc.nextLine();
        String S[] = new String[N];
        for (int i = 0; i < N; i++) {
            S[i] = sc.next();
        }
        Arrays.sort(S);
        StringBuffer buf = new StringBuffer("");
        for (int i = 0; i < N; i++) {
            buf.append(S[i]);
        }
        System.out.println(buf);
        sc.close();
    }   
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        sc.nextLine();
        String S[] = new String[N];
        for (int i = 0; i < N; i++) {
            S[i] = sc.next();
        }
        Arrays.sort(S);
        StringBuffer buf = new StringBuffer("");
        for (int i = 0; i < N; i++) {
            buf.append(S[i]);
        }
        System.out.println(buf);
        sc.close();
    }   
}
