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();
    List<String> a = new ArrayList<>();
    // String a[] = new String[N];
    for(int i=0; i<N ;i++){
        a.add(sc.next());
        // a[i] = sc.next();
    }
    Collections.sort(a);
    String sum = "";
    for(String s : a){
        sum = sum.concat(s);
    }
        System.out.println(sum); 

    }    
} 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();
    List<String> a = new ArrayList<>();
    // String a[] = new String[N];
    for(int i=0; i<N ;i++){
        a.add(sc.next());
        // a[i] = sc.next();
    }
    Collections.sort(a);
    String sum = "";
    for(String s : a){
        sum = sum.concat(s);
    }
        System.out.println(sum); 

    }    
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    List<String> a = new ArrayList<>();
    // String a[] = new String[N];
    for(int i=0; i<N ;i++){
        a.add(sc.next());
        // a[i] = sc.next();
    }
    Collections.sort(a);
    String sum = "";
    for(String s : a){
        sum = sum.concat(s);
    }
        System.out.println(sum); 

    } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    List<String> a = new ArrayList<>();
    // String a[] = new String[N];
    for(int i=0; i<N ;i++){
        a.add(sc.next());
        // a[i] = sc.next();
    }
    Collections.sort(a);
    String sum = "";
    for(String s : a){
        sum = sum.concat(s);
    }
        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 List<String> a = new ArrayList<>(); a new ArrayList<>() for(int i=0; i<N ;i++){
        a.add(sc.next());
        // a[i] = sc.next();
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
        a.add(sc.next());
        // a[i] = sc.next();
    } {
        a.add(sc.next());
        // a[i] = sc.next();
    } a.add(sc.next()) a.add a sc.next() sc.next sc Collections.sort(a) Collections.sort Collections a String sum = ""; sum "" for(String s : a){
        sum = sum.concat(s);
    } String s a {
        sum = sum.concat(s);
    } {
        sum = sum.concat(s);
    } sum = sum.concat(s) sum sum.concat(s) sum.concat sum s System.out.println(sum) System.out.println System.out System System.out sum 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();
    List<String> a = new ArrayList<>();
    // String a[] = new String[N];
    for(int i=0; i<N ;i++){
        a.add(sc.next());
        // a[i] = sc.next();
    }
    Collections.sort(a);
    String sum = "";
    for(String s : a){
        sum = sum.concat(s);
    }
        System.out.println(sum); 

    }    
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    List<String> a = new ArrayList<>();
    // String a[] = new String[N];
    for(int i=0; i<N ;i++){
        a.add(sc.next());
        // a[i] = sc.next();
    }
    Collections.sort(a);
    String sum = "";
    for(String s : a){
        sum = sum.concat(s);
    }
        System.out.println(sum); 

    }    
} 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();
    List<String> a = new ArrayList<>();
    // String a[] = new String[N];
    for(int i=0; i<N ;i++){
        a.add(sc.next());
        // a[i] = sc.next();
    }
    Collections.sort(a);
    String sum = "";
    for(String s : a){
        sum = sum.concat(s);
    }
        System.out.println(sum); 

    }    
}