import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    String[] line = new String[n];
    for (int cnt = 0; cnt < n; cnt++) {
      line[cnt] = sc.next();
    }
    Arrays.sort(line);
    for (int cnt = 0; cnt < n; cnt++) {
      System.out.print(line[cnt]);
    }
    sc.close();
  }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays 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[] line = new String[n];
    for (int cnt = 0; cnt < n; cnt++) {
      line[cnt] = sc.next();
    }
    Arrays.sort(line);
    for (int cnt = 0; cnt < n; cnt++) {
      System.out.print(line[cnt]);
    }
    sc.close();
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    String[] line = new String[n];
    for (int cnt = 0; cnt < n; cnt++) {
      line[cnt] = sc.next();
    }
    Arrays.sort(line);
    for (int cnt = 0; cnt < n; cnt++) {
      System.out.print(line[cnt]);
    }
    sc.close();
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    String[] line = new String[n];
    for (int cnt = 0; cnt < n; cnt++) {
      line[cnt] = sc.next();
    }
    Arrays.sort(line);
    for (int cnt = 0; cnt < n; cnt++) {
      System.out.print(line[cnt]);
    }
    sc.close();
  } 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[] line = new String[n]; line new String[n] n for (int cnt = 0; cnt < n; cnt++) {
      line[cnt] = sc.next();
    } int cnt = 0; int cnt = 0; cnt 0 cnt < n cnt n cnt++ cnt++ cnt {
      line[cnt] = sc.next();
    } {
      line[cnt] = sc.next();
    } line[cnt] = sc.next() line[cnt] line cnt sc.next() sc.next sc Arrays.sort(line) Arrays.sort Arrays line for (int cnt = 0; cnt < n; cnt++) {
      System.out.print(line[cnt]);
    } int cnt = 0; int cnt = 0; cnt 0 cnt < n cnt n cnt++ cnt++ cnt {
      System.out.print(line[cnt]);
    } {
      System.out.print(line[cnt]);
    } System.out.print(line[cnt]) System.out.print System.out System System.out line[cnt] line cnt sc.close() sc.close sc 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[] line = new String[n];
    for (int cnt = 0; cnt < n; cnt++) {
      line[cnt] = sc.next();
    }
    Arrays.sort(line);
    for (int cnt = 0; cnt < n; cnt++) {
      System.out.print(line[cnt]);
    }
    sc.close();
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    String[] line = new String[n];
    for (int cnt = 0; cnt < n; cnt++) {
      line[cnt] = sc.next();
    }
    Arrays.sort(line);
    for (int cnt = 0; cnt < n; cnt++) {
      System.out.print(line[cnt]);
    }
    sc.close();
  }
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    String[] line = new String[n];
    for (int cnt = 0; cnt < n; cnt++) {
      line[cnt] = sc.next();
    }
    Arrays.sort(line);
    for (int cnt = 0; cnt < n; cnt++) {
      System.out.print(line[cnt]);
    }
    sc.close();
  }
}