import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    StringBuilder sb = new StringBuilder();
    List<String> sList = new ArrayList<String>();
    for (int i = 0 ; i < n ; i++){
      sList.add(sc.next());
    }
    sList.sort(Comparator.naturalOrder());
    for (String s : sList){
      sb.append(s);
    }
    System.out.println(sb);
    sc.close();
 }
} import java.util.ArrayList; ArrayList java.util import java.util.Comparator; Comparator java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    StringBuilder sb = new StringBuilder();
    List<String> sList = new ArrayList<String>();
    for (int i = 0 ; i < n ; i++){
      sList.add(sc.next());
    }
    sList.sort(Comparator.naturalOrder());
    for (String s : sList){
      sb.append(s);
    }
    System.out.println(sb);
    sc.close();
 }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    StringBuilder sb = new StringBuilder();
    List<String> sList = new ArrayList<String>();
    for (int i = 0 ; i < n ; i++){
      sList.add(sc.next());
    }
    sList.sort(Comparator.naturalOrder());
    for (String s : sList){
      sb.append(s);
    }
    System.out.println(sb);
    sc.close();
 } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    StringBuilder sb = new StringBuilder();
    List<String> sList = new ArrayList<String>();
    for (int i = 0 ; i < n ; i++){
      sList.add(sc.next());
    }
    sList.sort(Comparator.naturalOrder());
    for (String s : sList){
      sb.append(s);
    }
    System.out.println(sb);
    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 StringBuilder sb = new StringBuilder(); sb new StringBuilder() List<String> sList = new ArrayList<String>(); sList new ArrayList<String>() for (int i = 0 ; i < n ; i++){
      sList.add(sc.next());
    } int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
      sList.add(sc.next());
    } {
      sList.add(sc.next());
    } sList.add(sc.next()) sList.add sList sc.next() sc.next sc sList.sort(Comparator.naturalOrder()) sList.sort sList Comparator.naturalOrder() Comparator.naturalOrder Comparator for (String s : sList){
      sb.append(s);
    } String s sList {
      sb.append(s);
    } {
      sb.append(s);
    } sb.append(s) sb.append sb s System.out.println(sb) System.out.println System.out System System.out sb sc.close() sc.close sc String[] args args
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    StringBuilder sb = new StringBuilder();
    List<String> sList = new ArrayList<String>();
    for (int i = 0 ; i < n ; i++){
      sList.add(sc.next());
    }
    sList.sort(Comparator.naturalOrder());
    for (String s : sList){
      sb.append(s);
    }
    System.out.println(sb);
    sc.close();
 }
}