import java.util.Scanner;

class Main {

	public static void main(String args[]){

		Scanner scan = new Scanner(System.in);
		int n,len;
		n = scan.nextInt();
		len = scan.nextInt();

		String s[] = new String[n];
		for(int i = 0; i < n; i++){
			s[i] = scan.next();
		}

		for(int i = 0; i < n; i++){
			for(int j = i; j < n; j++){
				if( s[j].compareTo(s[i]) < 0 ){
					swap(i,j,s);
				}
				
			}
		}
		for(int i = 0; i < n; i++){
			System.out.print(s[i]);
		}
	}

	static void swap(int x, int y, String[] s){
		String buf;
		buf = s[x]; s[x] = s[y]; s[y] = buf;
	}
} import java.util.Scanner; Scanner java.util class Main {

	public static void main(String args[]){

		Scanner scan = new Scanner(System.in);
		int n,len;
		n = scan.nextInt();
		len = scan.nextInt();

		String s[] = new String[n];
		for(int i = 0; i < n; i++){
			s[i] = scan.next();
		}

		for(int i = 0; i < n; i++){
			for(int j = i; j < n; j++){
				if( s[j].compareTo(s[i]) < 0 ){
					swap(i,j,s);
				}
				
			}
		}
		for(int i = 0; i < n; i++){
			System.out.print(s[i]);
		}
	}

	static void swap(int x, int y, String[] s){
		String buf;
		buf = s[x]; s[x] = s[y]; s[y] = buf;
	}
} Main public static void main(String args[]){

		Scanner scan = new Scanner(System.in);
		int n,len;
		n = scan.nextInt();
		len = scan.nextInt();

		String s[] = new String[n];
		for(int i = 0; i < n; i++){
			s[i] = scan.next();
		}

		for(int i = 0; i < n; i++){
			for(int j = i; j < n; j++){
				if( s[j].compareTo(s[i]) < 0 ){
					swap(i,j,s);
				}
				
			}
		}
		for(int i = 0; i < n; i++){
			System.out.print(s[i]);
		}
	} main {

		Scanner scan = new Scanner(System.in);
		int n,len;
		n = scan.nextInt();
		len = scan.nextInt();

		String s[] = new String[n];
		for(int i = 0; i < n; i++){
			s[i] = scan.next();
		}

		for(int i = 0; i < n; i++){
			for(int j = i; j < n; j++){
				if( s[j].compareTo(s[i]) < 0 ){
					swap(i,j,s);
				}
				
			}
		}
		for(int i = 0; i < n; i++){
			System.out.print(s[i]);
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n n len; len n = scan.nextInt() n scan.nextInt() scan.nextInt scan len = scan.nextInt() len 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 for(int i = 0; i < n; i++){
			for(int j = i; j < n; j++){
				if( s[j].compareTo(s[i]) < 0 ){
					swap(i,j,s);
				}
				
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			for(int j = i; j < n; j++){
				if( s[j].compareTo(s[i]) < 0 ){
					swap(i,j,s);
				}
				
			}
		} {
			for(int j = i; j < n; j++){
				if( s[j].compareTo(s[i]) < 0 ){
					swap(i,j,s);
				}
				
			}
		} for(int j = i; j < n; j++){
				if( s[j].compareTo(s[i]) < 0 ){
					swap(i,j,s);
				}
				
			} int j = i; int j = i; j i j < n j n j++ j++ j {
				if( s[j].compareTo(s[i]) < 0 ){
					swap(i,j,s);
				}
				
			} {
				if( s[j].compareTo(s[i]) < 0 ){
					swap(i,j,s);
				}
				
			} if( s[j].compareTo(s[i]) < 0 ){
					swap(i,j,s);
				} s[j].compareTo(s[i]) < 0 s[j].compareTo(s[i]) s[j].compareTo s[j] s j s[i] s i 0 {
					swap(i,j,s);
				} swap(i,j,s) swap i j 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 String args[] args static void swap(int x, int y, String[] s){
		String buf;
		buf = s[x]; s[x] = s[y]; s[y] = buf;
	} swap {
		String buf;
		buf = s[x]; s[x] = s[y]; s[y] = buf;
	} String buf; buf buf = s[x] buf s[x] s x s[x] = s[y] s[x] s x s[y] s y s[y] = buf s[y] s y buf int x x int y y String[] s s
import java.util.Scanner;

class Main {

	public static void main(String args[]){

		Scanner scan = new Scanner(System.in);
		int n,len;
		n = scan.nextInt();
		len = scan.nextInt();

		String s[] = new String[n];
		for(int i = 0; i < n; i++){
			s[i] = scan.next();
		}

		for(int i = 0; i < n; i++){
			for(int j = i; j < n; j++){
				if( s[j].compareTo(s[i]) < 0 ){
					swap(i,j,s);
				}
				
			}
		}
		for(int i = 0; i < n; i++){
			System.out.print(s[i]);
		}
	}

	static void swap(int x, int y, String[] s){
		String buf;
		buf = s[x]; s[x] = s[y]; s[y] = buf;
	}
}