import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		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();
		
		for(int i = 0;i < N;++i) {
			for(int j = i;j < N;++j) {
				if(S[i].compareTo(S[j]) > 0) {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				}
			}
		}
		
		for(int i = 0;i < N;++i)
			System.out.print(S[i]);
		System.out.println();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		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();
		
		for(int i = 0;i < N;++i) {
			for(int j = i;j < N;++j) {
				if(S[i].compareTo(S[j]) > 0) {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				}
			}
		}
		
		for(int i = 0;i < N;++i)
			System.out.print(S[i]);
		System.out.println();
	}
} Main public static void main(String[] args) {
		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();
		
		for(int i = 0;i < N;++i) {
			for(int j = i;j < N;++j) {
				if(S[i].compareTo(S[j]) > 0) {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				}
			}
		}
		
		for(int i = 0;i < N;++i)
			System.out.print(S[i]);
		System.out.println();
	} main {
		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();
		
		for(int i = 0;i < N;++i) {
			for(int j = i;j < N;++j) {
				if(S[i].compareTo(S[j]) > 0) {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				}
			}
		}
		
		for(int i = 0;i < N;++i)
			System.out.print(S[i]);
		System.out.println();
	} 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] S i sc.next() sc.next sc sc.close() sc.close sc for(int i = 0;i < N;++i) {
			for(int j = i;j < N;++j) {
				if(S[i].compareTo(S[j]) > 0) {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				}
			}
		} int i = 0; int i = 0; i 0 i < N i N ++i ++i i {
			for(int j = i;j < N;++j) {
				if(S[i].compareTo(S[j]) > 0) {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				}
			}
		} {
			for(int j = i;j < N;++j) {
				if(S[i].compareTo(S[j]) > 0) {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				}
			}
		} for(int j = i;j < N;++j) {
				if(S[i].compareTo(S[j]) > 0) {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				}
			} int j = i; int j = i; j i j < N j N ++j ++j j {
				if(S[i].compareTo(S[j]) > 0) {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				}
			} {
				if(S[i].compareTo(S[j]) > 0) {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				}
			} if(S[i].compareTo(S[j]) > 0) {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				} S[i].compareTo(S[j]) > 0 S[i].compareTo(S[j]) S[i].compareTo S[i] S i S[j] S j 0 {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				} String cap = S[i]; cap S[i] S i S[i] = S[j] S[i] S i S[j] S j S[j] = cap S[j] S j cap 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 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 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();
		
		for(int i = 0;i < N;++i) {
			for(int j = i;j < N;++j) {
				if(S[i].compareTo(S[j]) > 0) {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				}
			}
		}
		
		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 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();
		
		for(int i = 0;i < N;++i) {
			for(int j = i;j < N;++j) {
				if(S[i].compareTo(S[j]) > 0) {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				}
			}
		}
		
		for(int i = 0;i < N;++i)
			System.out.print(S[i]);
		System.out.println();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		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();
		
		for(int i = 0;i < N;++i) {
			for(int j = i;j < N;++j) {
				if(S[i].compareTo(S[j]) > 0) {
					String cap = S[i];
					S[i] = S[j];
					S[j] = cap;
				}
			}
		}
		
		for(int i = 0;i < N;++i)
			System.out.print(S[i]);
		System.out.println();
	}
}
