import java.util.*;
 
class Main {
  
    public static void main(String[] args) {
      
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());
        String moji[] = new String[N];
      
      for(int i=0;i<N;i++){
        moji[i] = sc.next();
      }

      Arrays.sort(moji);
      for(int i=0;i<N;i++){
        System.out.print(moji[i]);
      }
      
    }
} import java.util.*; util.* java class Main {
  
    public static void main(String[] args) {
      
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());
        String moji[] = new String[N];
      
      for(int i=0;i<N;i++){
        moji[i] = sc.next();
      }

      Arrays.sort(moji);
      for(int i=0;i<N;i++){
        System.out.print(moji[i]);
      }
      
    }
} Main public static void main(String[] args) {
      
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());
        String moji[] = new String[N];
      
      for(int i=0;i<N;i++){
        moji[i] = sc.next();
      }

      Arrays.sort(moji);
      for(int i=0;i<N;i++){
        System.out.print(moji[i]);
      }
      
    } main {
      
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());
        String moji[] = new String[N];
      
      for(int i=0;i<N;i++){
        moji[i] = sc.next();
      }

      Arrays.sort(moji);
      for(int i=0;i<N;i++){
        System.out.print(moji[i]);
      }
      
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int L = Integer.parseInt(sc.next()); L Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc String moji[] = new String[N]; moji new String[N] N for(int i=0;i<N;i++){
        moji[i] = sc.next();
      } int i=0; int i=0; i 0 i<N i N i++ i++ i {
        moji[i] = sc.next();
      } {
        moji[i] = sc.next();
      } moji[i] = sc.next() moji[i] moji i sc.next() sc.next sc Arrays.sort(moji) Arrays.sort Arrays moji for(int i=0;i<N;i++){
        System.out.print(moji[i]);
      } int i=0; int i=0; i 0 i<N i N i++ i++ i {
        System.out.print(moji[i]);
      } {
        System.out.print(moji[i]);
      } System.out.print(moji[i]) System.out.print System.out System System.out moji[i] moji i String[] args args
import java.util.*;
 
class Main {
  
    public static void main(String[] args) {
      
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int L = Integer.parseInt(sc.next());
        String moji[] = new String[N];
      
      for(int i=0;i<N;i++){
        moji[i] = sc.next();
      }

      Arrays.sort(moji);
      for(int i=0;i<N;i++){
        System.out.print(moji[i]);
      }
      
    }
}