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 < s.length; i++) {
			s[i] = sc.next();
		}
		sc.close();

		int imin;
		for (int i = 0; i < s.length - 1; i++) {
			imin = i;
			for (int j = i + 1; j < s.length; j++) {
				if (s[imin].compareTo(s[j]) > 0) {
					imin = j;
				}
			}
			if (imin != i) {
				exchange(s, imin, i);
			}
		}

		String sum = "";
		for (String str : s) {
			sum += str;
		}

		System.out.println(sum);
	}

	public static void exchange(String[] s, int a, int b) {
		String str = s[a];
		s[a] = s[b];
		s[b] = str;
	}

} 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 < s.length; i++) {
			s[i] = sc.next();
		}
		sc.close();

		int imin;
		for (int i = 0; i < s.length - 1; i++) {
			imin = i;
			for (int j = i + 1; j < s.length; j++) {
				if (s[imin].compareTo(s[j]) > 0) {
					imin = j;
				}
			}
			if (imin != i) {
				exchange(s, imin, i);
			}
		}

		String sum = "";
		for (String str : s) {
			sum += str;
		}

		System.out.println(sum);
	}

	public static void exchange(String[] s, int a, int b) {
		String str = s[a];
		s[a] = s[b];
		s[b] = str;
	}

} 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 < s.length; i++) {
			s[i] = sc.next();
		}
		sc.close();

		int imin;
		for (int i = 0; i < s.length - 1; i++) {
			imin = i;
			for (int j = i + 1; j < s.length; j++) {
				if (s[imin].compareTo(s[j]) > 0) {
					imin = j;
				}
			}
			if (imin != i) {
				exchange(s, imin, i);
			}
		}

		String sum = "";
		for (String str : s) {
			sum += str;
		}

		System.out.println(sum);
	} 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 < s.length; i++) {
			s[i] = sc.next();
		}
		sc.close();

		int imin;
		for (int i = 0; i < s.length - 1; i++) {
			imin = i;
			for (int j = i + 1; j < s.length; j++) {
				if (s[imin].compareTo(s[j]) > 0) {
					imin = j;
				}
			}
			if (imin != i) {
				exchange(s, imin, i);
			}
		}

		String sum = "";
		for (String str : s) {
			sum += str;
		}

		System.out.println(sum);
	} 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 < s.length; i++) {
			s[i] = sc.next();
		} int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
			s[i] = sc.next();
		} {
			s[i] = sc.next();
		} s[i] = sc.next() s[i] s i sc.next() sc.next sc sc.close() sc.close sc int imin; imin for (int i = 0; i < s.length - 1; i++) {
			imin = i;
			for (int j = i + 1; j < s.length; j++) {
				if (s[imin].compareTo(s[j]) > 0) {
					imin = j;
				}
			}
			if (imin != i) {
				exchange(s, imin, i);
			}
		} int i = 0; int i = 0; i 0 i < s.length - 1 i s.length - 1 s.length s s.length 1 i++ i++ i {
			imin = i;
			for (int j = i + 1; j < s.length; j++) {
				if (s[imin].compareTo(s[j]) > 0) {
					imin = j;
				}
			}
			if (imin != i) {
				exchange(s, imin, i);
			}
		} {
			imin = i;
			for (int j = i + 1; j < s.length; j++) {
				if (s[imin].compareTo(s[j]) > 0) {
					imin = j;
				}
			}
			if (imin != i) {
				exchange(s, imin, i);
			}
		} imin = i imin i for (int j = i + 1; j < s.length; j++) {
				if (s[imin].compareTo(s[j]) > 0) {
					imin = j;
				}
			} int j = i + 1; int j = i + 1; j i + 1 i 1 j < s.length j s.length s s.length j++ j++ j {
				if (s[imin].compareTo(s[j]) > 0) {
					imin = j;
				}
			} {
				if (s[imin].compareTo(s[j]) > 0) {
					imin = j;
				}
			} if (s[imin].compareTo(s[j]) > 0) {
					imin = j;
				} s[imin].compareTo(s[j]) > 0 s[imin].compareTo(s[j]) s[imin].compareTo s[imin] s imin s[j] s j 0 {
					imin = j;
				} imin = j imin j if (imin != i) {
				exchange(s, imin, i);
			} imin != i imin i {
				exchange(s, imin, i);
			} exchange(s, imin, i) exchange s imin i String sum = ""; sum "" for (String str : s) {
			sum += str;
		} String str s {
			sum += str;
		} {
			sum += str;
		} sum += str sum str System.out.println(sum) System.out.println System.out System System.out sum String[] args args public static void exchange(String[] s, int a, int b) {
		String str = s[a];
		s[a] = s[b];
		s[b] = str;
	} exchange {
		String str = s[a];
		s[a] = s[b];
		s[b] = str;
	} String str = s[a]; str s[a] s a s[a] = s[b] s[a] s a s[b] s b s[b] = str s[b] s b str String[] s s int a a int b b 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 < s.length; i++) {
			s[i] = sc.next();
		}
		sc.close();

		int imin;
		for (int i = 0; i < s.length - 1; i++) {
			imin = i;
			for (int j = i + 1; j < s.length; j++) {
				if (s[imin].compareTo(s[j]) > 0) {
					imin = j;
				}
			}
			if (imin != i) {
				exchange(s, imin, i);
			}
		}

		String sum = "";
		for (String str : s) {
			sum += str;
		}

		System.out.println(sum);
	}

	public static void exchange(String[] s, int a, int b) {
		String str = s[a];
		s[a] = s[b];
		s[b] = str;
	}

} 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 < s.length; i++) {
			s[i] = sc.next();
		}
		sc.close();

		int imin;
		for (int i = 0; i < s.length - 1; i++) {
			imin = i;
			for (int j = i + 1; j < s.length; j++) {
				if (s[imin].compareTo(s[j]) > 0) {
					imin = j;
				}
			}
			if (imin != i) {
				exchange(s, imin, i);
			}
		}

		String sum = "";
		for (String str : s) {
			sum += str;
		}

		System.out.println(sum);
	}

	public static void exchange(String[] s, int a, int b) {
		String str = s[a];
		s[a] = s[b];
		s[b] = str;
	}

} 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 < s.length; i++) {
			s[i] = sc.next();
		}
		sc.close();

		int imin;
		for (int i = 0; i < s.length - 1; i++) {
			imin = i;
			for (int j = i + 1; j < s.length; j++) {
				if (s[imin].compareTo(s[j]) > 0) {
					imin = j;
				}
			}
			if (imin != i) {
				exchange(s, imin, i);
			}
		}

		String sum = "";
		for (String str : s) {
			sum += str;
		}

		System.out.println(sum);
	}

	public static void exchange(String[] s, int a, int b) {
		String str = s[a];
		s[a] = s[b];
		s[b] = str;
	}

}
