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[] moji = new String[N];
		
		for(int i = 0;i<N;i++){
			moji[i] = scan.next();
		}
		
		Arrays.sort(moji);
		
		StringBuilder sb = new StringBuilder();
		
		for(int j = 0;j<N;j++){
			sb.append(moji[j]);
		}
		
		System.out.println(sb.toString());
		
		
		
		
	}

} 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[] moji = new String[N];
		
		for(int i = 0;i<N;i++){
			moji[i] = scan.next();
		}
		
		Arrays.sort(moji);
		
		StringBuilder sb = new StringBuilder();
		
		for(int j = 0;j<N;j++){
			sb.append(moji[j]);
		}
		
		System.out.println(sb.toString());
		
		
		
		
	}

} Main public static void main(String[]args){
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int L = scan.nextInt();
		
		String[] moji = new String[N];
		
		for(int i = 0;i<N;i++){
			moji[i] = scan.next();
		}
		
		Arrays.sort(moji);
		
		StringBuilder sb = new StringBuilder();
		
		for(int j = 0;j<N;j++){
			sb.append(moji[j]);
		}
		
		System.out.println(sb.toString());
		
		
		
		
	} main {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int L = scan.nextInt();
		
		String[] moji = new String[N];
		
		for(int i = 0;i<N;i++){
			moji[i] = scan.next();
		}
		
		Arrays.sort(moji);
		
		StringBuilder sb = new StringBuilder();
		
		for(int j = 0;j<N;j++){
			sb.append(moji[j]);
		}
		
		System.out.println(sb.toString());
		
		
		
		
	} 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[] moji = new String[N]; moji new String[N] N for(int i = 0;i<N;i++){
			moji[i] = scan.next();
		} int i = 0; int i = 0; i 0 i<N i N i++ i++ i {
			moji[i] = scan.next();
		} {
			moji[i] = scan.next();
		} moji[i] = scan.next() moji[i] moji i scan.next() scan.next scan Arrays.sort(moji) Arrays.sort Arrays moji StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int j = 0;j<N;j++){
			sb.append(moji[j]);
		} int j = 0; int j = 0; j 0 j<N j N j++ j++ j {
			sb.append(moji[j]);
		} {
			sb.append(moji[j]);
		} sb.append(moji[j]) sb.append sb moji[j] moji j System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb 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[] moji = new String[N];
		
		for(int i = 0;i<N;i++){
			moji[i] = scan.next();
		}
		
		Arrays.sort(moji);
		
		StringBuilder sb = new StringBuilder();
		
		for(int j = 0;j<N;j++){
			sb.append(moji[j]);
		}
		
		System.out.println(sb.toString());
		
		
		
		
	}

} public class Main {
	public static void main(String[]args){
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int L = scan.nextInt();
		
		String[] moji = new String[N];
		
		for(int i = 0;i<N;i++){
			moji[i] = scan.next();
		}
		
		Arrays.sort(moji);
		
		StringBuilder sb = new StringBuilder();
		
		for(int j = 0;j<N;j++){
			sb.append(moji[j]);
		}
		
		System.out.println(sb.toString());
		
		
		
		
	}

} 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[] moji = new String[N];
		
		for(int i = 0;i<N;i++){
			moji[i] = scan.next();
		}
		
		Arrays.sort(moji);
		
		StringBuilder sb = new StringBuilder();
		
		for(int j = 0;j<N;j++){
			sb.append(moji[j]);
		}
		
		System.out.println(sb.toString());
		
		
		
		
	}

}