

import java.util.*;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n, l;
		String s[];
		
		n = sc.nextInt();
		l = sc.nextInt();	
		
		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 = i + 1; j < n; ++j) {
				if(s[i].compareToIgnoreCase(s[j])>0) {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				}
			}
		}
		
		for(int i = 0; i < n; ++i) {
			System.out.print(s[i]);
		}
		System.out.println();
		
		sc.close();
		
	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n, l;
		String s[];
		
		n = sc.nextInt();
		l = sc.nextInt();	
		
		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 = i + 1; j < n; ++j) {
				if(s[i].compareToIgnoreCase(s[j])>0) {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				}
			}
		}
		
		for(int i = 0; i < n; ++i) {
			System.out.print(s[i]);
		}
		System.out.println();
		
		sc.close();
		
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n, l;
		String s[];
		
		n = sc.nextInt();
		l = sc.nextInt();	
		
		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 = i + 1; j < n; ++j) {
				if(s[i].compareToIgnoreCase(s[j])>0) {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				}
			}
		}
		
		for(int i = 0; i < n; ++i) {
			System.out.print(s[i]);
		}
		System.out.println();
		
		sc.close();
		
	} main {
		Scanner sc = new Scanner(System.in);
		
		int n, l;
		String s[];
		
		n = sc.nextInt();
		l = sc.nextInt();	
		
		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 = i + 1; j < n; ++j) {
				if(s[i].compareToIgnoreCase(s[j])>0) {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				}
			}
		}
		
		for(int i = 0; i < n; ++i) {
			System.out.print(s[i]);
		}
		System.out.println();
		
		sc.close();
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n n l; l String s[]; s n = sc.nextInt() n sc.nextInt() sc.nextInt sc l = sc.nextInt() l sc.nextInt() sc.nextInt sc 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 = i + 1; j < n; ++j) {
				if(s[i].compareToIgnoreCase(s[j])>0) {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				}
			}
		} int i = 0; int i = 0; i 0 i < n i n ++i ++i i {
			for(int j = i + 1; j < n; ++j) {
				if(s[i].compareToIgnoreCase(s[j])>0) {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				}
			}
		} {
			for(int j = i + 1; j < n; ++j) {
				if(s[i].compareToIgnoreCase(s[j])>0) {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				}
			}
		} for(int j = i + 1; j < n; ++j) {
				if(s[i].compareToIgnoreCase(s[j])>0) {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				}
			} int j = i + 1; int j = i + 1; j i + 1 i 1 j < n j n ++j ++j j {
				if(s[i].compareToIgnoreCase(s[j])>0) {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				}
			} {
				if(s[i].compareToIgnoreCase(s[j])>0) {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				}
			} if(s[i].compareToIgnoreCase(s[j])>0) {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				} s[i].compareToIgnoreCase(s[j])>0 s[i].compareToIgnoreCase(s[j]) s[i].compareToIgnoreCase s[i] s i s[j] s j 0 {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				} String tmp = s[i]; tmp s[i] s i s[i] = s[j] s[i] s i s[j] s j s[j] = tmp s[j] s j tmp 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 sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n, l;
		String s[];
		
		n = sc.nextInt();
		l = sc.nextInt();	
		
		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 = i + 1; j < n; ++j) {
				if(s[i].compareToIgnoreCase(s[j])>0) {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				}
			}
		}
		
		for(int i = 0; i < n; ++i) {
			System.out.print(s[i]);
		}
		System.out.println();
		
		sc.close();
		
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n, l;
		String s[];
		
		n = sc.nextInt();
		l = sc.nextInt();	
		
		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 = i + 1; j < n; ++j) {
				if(s[i].compareToIgnoreCase(s[j])>0) {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				}
			}
		}
		
		for(int i = 0; i < n; ++i) {
			System.out.print(s[i]);
		}
		System.out.println();
		
		sc.close();
		
	}

} Main


import java.util.*;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n, l;
		String s[];
		
		n = sc.nextInt();
		l = sc.nextInt();	
		
		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 = i + 1; j < n; ++j) {
				if(s[i].compareToIgnoreCase(s[j])>0) {
					String tmp = s[i];
					s[i] = s[j];
					s[j] = tmp;
				}
			}
		}
		
		for(int i = 0; i < n; ++i) {
			System.out.print(s[i]);
		}
		System.out.println();
		
		sc.close();
		
	}

}
