import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

		Arrays.sort(s);
		for(int i=0;i<n;i++) {
			System.out.print(s[i]);
		}
		System.out.println();

	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

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

		Arrays.sort(s);
		for(int i=0;i<n;i++) {
			System.out.print(s[i]);
		}
		System.out.println();

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

		Arrays.sort(s);
		for(int i=0;i<n;i++) {
			System.out.print(s[i]);
		}
		System.out.println();

	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		String s[] = new String[n];
		for(int i=0;i<n;i++) {
			s[i]=scan.next();
		}
		scan.close();

		Arrays.sort(s);
		for(int i=0;i<n;i++) {
			System.out.print(s[i]);
		}
		System.out.println();

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int l = scan.nextInt(); l scan.nextInt() scan.nextInt scan String s[] = new String[n]; s new String[n] n for(int i=0;i<n;i++) {
			s[i]=scan.next();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			s[i]=scan.next();
		} {
			s[i]=scan.next();
		} s[i]=scan.next() s[i] s i scan.next() scan.next scan scan.close() scan.close scan Arrays.sort(s) Arrays.sort Arrays s for(int i=0;i<n;i++) {
			System.out.print(s[i]);
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			System.out.print(s[i]);
		} {
			System.out.print(s[i]);
		} System.out.print(s[i]) System.out.print System.out System System.out s[i] s i System.out.println() System.out.println System.out System System.out String[] args args public class Main {

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

		Arrays.sort(s);
		for(int i=0;i<n;i++) {
			System.out.print(s[i]);
		}
		System.out.println();

	}
} public class Main {

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

		Arrays.sort(s);
		for(int i=0;i<n;i++) {
			System.out.print(s[i]);
		}
		System.out.println();

	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

		Arrays.sort(s);
		for(int i=0;i<n;i++) {
			System.out.print(s[i]);
		}
		System.out.println();

	}
}
