import java.util.Scanner;
import java.util.ArrayList;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    
    int n = scanner.nextInt();
    int l = scanner.nextInt();
    
    ArrayList<String> word = new ArrayList<>();
    
    // N回データを取得し格納する
    for(int i = 0; i < n; i++) {
      word.add(scanner.next());
    }
    
    // データをソートする
    boolean changed = true;
    while(changed) {
      changed = false;
      for(int i = 1; i < n; i++) {
        if(compare(word.get(i), word.get(i - 1))) {
          String tmp; // 退避しておくところ
          tmp = word.get(i);
          word.set(i, word.get(i - 1));
          word.set(i - 1, tmp);
          changed = true;
        }
      }
    }
    
    for(String w: word) {
      System.out.print(w);
    }
  }
  
  
  public static boolean compare(String str1,String str2) {
    return str1.compareTo(str2) < 0;
  }
} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    
    int n = scanner.nextInt();
    int l = scanner.nextInt();
    
    ArrayList<String> word = new ArrayList<>();
    
    // N回データを取得し格納する
    for(int i = 0; i < n; i++) {
      word.add(scanner.next());
    }
    
    // データをソートする
    boolean changed = true;
    while(changed) {
      changed = false;
      for(int i = 1; i < n; i++) {
        if(compare(word.get(i), word.get(i - 1))) {
          String tmp; // 退避しておくところ
          tmp = word.get(i);
          word.set(i, word.get(i - 1));
          word.set(i - 1, tmp);
          changed = true;
        }
      }
    }
    
    for(String w: word) {
      System.out.print(w);
    }
  }
  
  
  public static boolean compare(String str1,String str2) {
    return str1.compareTo(str2) < 0;
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    
    int n = scanner.nextInt();
    int l = scanner.nextInt();
    
    ArrayList<String> word = new ArrayList<>();
    
    // N回データを取得し格納する
    for(int i = 0; i < n; i++) {
      word.add(scanner.next());
    }
    
    // データをソートする
    boolean changed = true;
    while(changed) {
      changed = false;
      for(int i = 1; i < n; i++) {
        if(compare(word.get(i), word.get(i - 1))) {
          String tmp; // 退避しておくところ
          tmp = word.get(i);
          word.set(i, word.get(i - 1));
          word.set(i - 1, tmp);
          changed = true;
        }
      }
    }
    
    for(String w: word) {
      System.out.print(w);
    }
  } main {
    Scanner scanner = new Scanner(System.in);
    
    int n = scanner.nextInt();
    int l = scanner.nextInt();
    
    ArrayList<String> word = new ArrayList<>();
    
    // N回データを取得し格納する
    for(int i = 0; i < n; i++) {
      word.add(scanner.next());
    }
    
    // データをソートする
    boolean changed = true;
    while(changed) {
      changed = false;
      for(int i = 1; i < n; i++) {
        if(compare(word.get(i), word.get(i - 1))) {
          String tmp; // 退避しておくところ
          tmp = word.get(i);
          word.set(i, word.get(i - 1));
          word.set(i - 1, tmp);
          changed = true;
        }
      }
    }
    
    for(String w: word) {
      System.out.print(w);
    }
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int l = scanner.nextInt(); l scanner.nextInt() scanner.nextInt scanner ArrayList<String> word = new ArrayList<>(); word new ArrayList<>() for(int i = 0; i < n; i++) {
      word.add(scanner.next());
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      word.add(scanner.next());
    } {
      word.add(scanner.next());
    } word.add(scanner.next()) word.add word scanner.next() scanner.next scanner boolean changed = true; changed true while(changed) {
      changed = false;
      for(int i = 1; i < n; i++) {
        if(compare(word.get(i), word.get(i - 1))) {
          String tmp; // 退避しておくところ
          tmp = word.get(i);
          word.set(i, word.get(i - 1));
          word.set(i - 1, tmp);
          changed = true;
        }
      }
    } changed {
      changed = false;
      for(int i = 1; i < n; i++) {
        if(compare(word.get(i), word.get(i - 1))) {
          String tmp; // 退避しておくところ
          tmp = word.get(i);
          word.set(i, word.get(i - 1));
          word.set(i - 1, tmp);
          changed = true;
        }
      }
    } changed = false changed false for(int i = 1; i < n; i++) {
        if(compare(word.get(i), word.get(i - 1))) {
          String tmp; // 退避しておくところ
          tmp = word.get(i);
          word.set(i, word.get(i - 1));
          word.set(i - 1, tmp);
          changed = true;
        }
      } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
        if(compare(word.get(i), word.get(i - 1))) {
          String tmp; // 退避しておくところ
          tmp = word.get(i);
          word.set(i, word.get(i - 1));
          word.set(i - 1, tmp);
          changed = true;
        }
      } {
        if(compare(word.get(i), word.get(i - 1))) {
          String tmp; // 退避しておくところ
          tmp = word.get(i);
          word.set(i, word.get(i - 1));
          word.set(i - 1, tmp);
          changed = true;
        }
      } if(compare(word.get(i), word.get(i - 1))) {
          String tmp; // 退避しておくところ
          tmp = word.get(i);
          word.set(i, word.get(i - 1));
          word.set(i - 1, tmp);
          changed = true;
        } compare(word.get(i), word.get(i - 1)) compare word.get(i) word.get word i word.get(i - 1) word.get word i - 1 i 1 {
          String tmp; // 退避しておくところ
          tmp = word.get(i);
          word.set(i, word.get(i - 1));
          word.set(i - 1, tmp);
          changed = true;
        } String tmp; tmp tmp = word.get(i) tmp word.get(i) word.get word i word.set(i, word.get(i - 1)) word.set word i word.get(i - 1) word.get word i - 1 i 1 word.set(i - 1, tmp) word.set word i - 1 i 1 tmp changed = true changed true for(String w: word) {
      System.out.print(w);
    } String w word {
      System.out.print(w);
    } {
      System.out.print(w);
    } System.out.print(w) System.out.print System.out System System.out w String[] args args public static boolean compare(String str1,String str2) {
    return str1.compareTo(str2) < 0;
  } compare {
    return str1.compareTo(str2) < 0;
  } return str1.compareTo(str2) < 0; str1.compareTo(str2) < 0 str1.compareTo(str2) str1.compareTo str1 str2 0 String str1 str1 String str2 str2 public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    
    int n = scanner.nextInt();
    int l = scanner.nextInt();
    
    ArrayList<String> word = new ArrayList<>();
    
    // N回データを取得し格納する
    for(int i = 0; i < n; i++) {
      word.add(scanner.next());
    }
    
    // データをソートする
    boolean changed = true;
    while(changed) {
      changed = false;
      for(int i = 1; i < n; i++) {
        if(compare(word.get(i), word.get(i - 1))) {
          String tmp; // 退避しておくところ
          tmp = word.get(i);
          word.set(i, word.get(i - 1));
          word.set(i - 1, tmp);
          changed = true;
        }
      }
    }
    
    for(String w: word) {
      System.out.print(w);
    }
  }
  
  
  public static boolean compare(String str1,String str2) {
    return str1.compareTo(str2) < 0;
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    
    int n = scanner.nextInt();
    int l = scanner.nextInt();
    
    ArrayList<String> word = new ArrayList<>();
    
    // N回データを取得し格納する
    for(int i = 0; i < n; i++) {
      word.add(scanner.next());
    }
    
    // データをソートする
    boolean changed = true;
    while(changed) {
      changed = false;
      for(int i = 1; i < n; i++) {
        if(compare(word.get(i), word.get(i - 1))) {
          String tmp; // 退避しておくところ
          tmp = word.get(i);
          word.set(i, word.get(i - 1));
          word.set(i - 1, tmp);
          changed = true;
        }
      }
    }
    
    for(String w: word) {
      System.out.print(w);
    }
  }
  
  
  public static boolean compare(String str1,String str2) {
    return str1.compareTo(str2) < 0;
  }
} Main
import java.util.Scanner;
import java.util.ArrayList;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    
    int n = scanner.nextInt();
    int l = scanner.nextInt();
    
    ArrayList<String> word = new ArrayList<>();
    
    // N回データを取得し格納する
    for(int i = 0; i < n; i++) {
      word.add(scanner.next());
    }
    
    // データをソートする
    boolean changed = true;
    while(changed) {
      changed = false;
      for(int i = 1; i < n; i++) {
        if(compare(word.get(i), word.get(i - 1))) {
          String tmp; // 退避しておくところ
          tmp = word.get(i);
          word.set(i, word.get(i - 1));
          word.set(i - 1, tmp);
          changed = true;
        }
      }
    }
    
    for(String w: word) {
      System.out.print(w);
    }
  }
  
  
  public static boolean compare(String str1,String str2) {
    return str1.compareTo(str2) < 0;
  }
}
