import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    ArrayList<String> S = new ArrayList<String>();
    for(int i = 0;i < N;i++){
      S.add(sc.next());
    }
    Collections.sort(S);
    for(int a = 0;a < N;a++){
      System.out.print(S.get(a));
    }
  }
} import java.util.*; util.* java class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    ArrayList<String> S = new ArrayList<String>();
    for(int i = 0;i < N;i++){
      S.add(sc.next());
    }
    Collections.sort(S);
    for(int a = 0;a < N;a++){
      System.out.print(S.get(a));
    }
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    ArrayList<String> S = new ArrayList<String>();
    for(int i = 0;i < N;i++){
      S.add(sc.next());
    }
    Collections.sort(S);
    for(int a = 0;a < N;a++){
      System.out.print(S.get(a));
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    ArrayList<String> S = new ArrayList<String>();
    for(int i = 0;i < N;i++){
      S.add(sc.next());
    }
    Collections.sort(S);
    for(int a = 0;a < N;a++){
      System.out.print(S.get(a));
    }
  } 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 ArrayList<String> S = new ArrayList<String>(); S new ArrayList<String>() for(int i = 0;i < N;i++){
      S.add(sc.next());
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      S.add(sc.next());
    } {
      S.add(sc.next());
    } S.add(sc.next()) S.add S sc.next() sc.next sc Collections.sort(S) Collections.sort Collections S for(int a = 0;a < N;a++){
      System.out.print(S.get(a));
    } int a = 0; int a = 0; a 0 a < N a N a++ a++ a {
      System.out.print(S.get(a));
    } {
      System.out.print(S.get(a));
    } System.out.print(S.get(a)) System.out.print System.out System System.out S.get(a) S.get S a String[] args args
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    ArrayList<String> S = new ArrayList<String>();
    for(int i = 0;i < N;i++){
      S.add(sc.next());
    }
    Collections.sort(S);
    for(int a = 0;a < N;a++){
      System.out.print(S.get(a));
    }
  }
}
