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[] str = new String[N];
      for (int i=0;i<N;i++) {
        str[i] = sc.next();
      }
      Arrays.sort(str);
      for(String out : str){
        System.out.print(out);
      }
    }
} 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[] str = new String[N];
      for (int i=0;i<N;i++) {
        str[i] = sc.next();
      }
      Arrays.sort(str);
      for(String out : str){
        System.out.print(out);
      }
    }
} Main public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      int L = sc.nextInt();
      String[] str = new String[N];
      for (int i=0;i<N;i++) {
        str[i] = sc.next();
      }
      Arrays.sort(str);
      for(String out : str){
        System.out.print(out);
      }
    } main {
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      int L = sc.nextInt();
      String[] str = new String[N];
      for (int i=0;i<N;i++) {
        str[i] = sc.next();
      }
      Arrays.sort(str);
      for(String out : str){
        System.out.print(out);
      }
    } 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[] str = new String[N]; str new String[N] N for (int i=0;i<N;i++) {
        str[i] = sc.next();
      } int i=0; int i=0; i 0 i<N i N i++ i++ i {
        str[i] = sc.next();
      } {
        str[i] = sc.next();
      } str[i] = sc.next() str[i] str i sc.next() sc.next sc Arrays.sort(str) Arrays.sort Arrays str for(String out : str){
        System.out.print(out);
      } String out str {
        System.out.print(out);
      } {
        System.out.print(out);
      } System.out.print(out) System.out.print System.out System System.out 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[] str = new String[N];
      for (int i=0;i<N;i++) {
        str[i] = sc.next();
      }
      Arrays.sort(str);
      for(String out : str){
        System.out.print(out);
      }
    }
} public class Main {
	public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      int L = sc.nextInt();
      String[] str = new String[N];
      for (int i=0;i<N;i++) {
        str[i] = sc.next();
      }
      Arrays.sort(str);
      for(String out : str){
        System.out.print(out);
      }
    }
} 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[] str = new String[N];
      for (int i=0;i<N;i++) {
        str[i] = sc.next();
      }
      Arrays.sort(str);
      for(String out : str){
        System.out.print(out);
      }
    }
}