import 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();
		}
		for(int i=0; i<N; i++){
			for(int j=N-1; j>i; j--){
				if(s[j].compareTo(s[j-1])<0){
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				}
			}
			System.out.print(s[i]);
		}
		System.out.println("");
	}
} import java.util.*; util.* java 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();
		}
		for(int i=0; i<N; i++){
			for(int j=N-1; j>i; j--){
				if(s[j].compareTo(s[j-1])<0){
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				}
			}
			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();
		}
		for(int i=0; i<N; i++){
			for(int j=N-1; j>i; j--){
				if(s[j].compareTo(s[j-1])<0){
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				}
			}
			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();
		}
		for(int i=0; i<N; i++){
			for(int j=N-1; j>i; j--){
				if(s[j].compareTo(s[j-1])<0){
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				}
			}
			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] = sc.next() s[i] s i sc.next() sc.next sc for(int i=0; i<N; i++){
			for(int j=N-1; j>i; j--){
				if(s[j].compareTo(s[j-1])<0){
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				}
			}
			System.out.print(s[i]);
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			for(int j=N-1; j>i; j--){
				if(s[j].compareTo(s[j-1])<0){
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				}
			}
			System.out.print(s[i]);
		} {
			for(int j=N-1; j>i; j--){
				if(s[j].compareTo(s[j-1])<0){
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				}
			}
			System.out.print(s[i]);
		} for(int j=N-1; j>i; j--){
				if(s[j].compareTo(s[j-1])<0){
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				}
			} int j=N-1; int j=N-1; j N-1 N 1 j>i j i j-- j-- j {
				if(s[j].compareTo(s[j-1])<0){
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				}
			} {
				if(s[j].compareTo(s[j-1])<0){
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				}
			} if(s[j].compareTo(s[j-1])<0){
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				} s[j].compareTo(s[j-1])<0 s[j].compareTo(s[j-1]) s[j].compareTo s[j] s j s[j-1] s j-1 j 1 0 {
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				} String exc = s[j]; exc s[j] s j s[j] = s[j-1] s[j] s j s[j-1] s j-1 j 1 s[j-1] = exc s[j-1] s j-1 j 1 exc 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();
		}
		for(int i=0; i<N; i++){
			for(int j=N-1; j>i; j--){
				if(s[j].compareTo(s[j-1])<0){
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				}
			}
			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();
		}
		for(int i=0; i<N; i++){
			for(int j=N-1; j>i; j--){
				if(s[j].compareTo(s[j-1])<0){
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				}
			}
			System.out.print(s[i]);
		}
		System.out.println("");
	}
} Main
import 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();
		}
		for(int i=0; i<N; i++){
			for(int j=N-1; j>i; j--){
				if(s[j].compareTo(s[j-1])<0){
					String exc = s[j];
					s[j] = s[j-1];
					s[j-1] = exc;
				}
			}
			System.out.print(s[i]);
		}
		System.out.println("");
	}
}