/*
* @Author Silviase(@silviasetitech)
* For ProCon
*/

import java.util.*;
import java.lang.*;
import java.math.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int len = sc.nextInt();
        List l = new ArrayList<String>();
        for (int i = 0; i < n; i++) {
            String tmp = sc.next();
            l.add(tmp);
        }
        Collections.sort(l);
        for (int i = 0; i < l.size(); i++) {
            System.out.print(l.get(i));
            if (i == l.size()-1) {
                System.out.println("");
            }
        }

        sc.close();
    }

}


 import java.util.*; util.* java import java.lang.*; lang.* java import java.math.*; math.* java class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int len = sc.nextInt();
        List l = new ArrayList<String>();
        for (int i = 0; i < n; i++) {
            String tmp = sc.next();
            l.add(tmp);
        }
        Collections.sort(l);
        for (int i = 0; i < l.size(); i++) {
            System.out.print(l.get(i));
            if (i == l.size()-1) {
                System.out.println("");
            }
        }

        sc.close();
    }

} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int len = sc.nextInt();
        List l = new ArrayList<String>();
        for (int i = 0; i < n; i++) {
            String tmp = sc.next();
            l.add(tmp);
        }
        Collections.sort(l);
        for (int i = 0; i < l.size(); i++) {
            System.out.print(l.get(i));
            if (i == l.size()-1) {
                System.out.println("");
            }
        }

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int len = sc.nextInt();
        List l = new ArrayList<String>();
        for (int i = 0; i < n; i++) {
            String tmp = sc.next();
            l.add(tmp);
        }
        Collections.sort(l);
        for (int i = 0; i < l.size(); i++) {
            System.out.print(l.get(i));
            if (i == l.size()-1) {
                System.out.println("");
            }
        }

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int len = sc.nextInt(); len sc.nextInt() sc.nextInt sc List l = new ArrayList<String>(); l new ArrayList<String>() for (int i = 0; i < n; i++) {
            String tmp = sc.next();
            l.add(tmp);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String tmp = sc.next();
            l.add(tmp);
        } {
            String tmp = sc.next();
            l.add(tmp);
        } String tmp = sc.next(); tmp sc.next() sc.next sc l.add(tmp) l.add l tmp Collections.sort(l) Collections.sort Collections l for (int i = 0; i < l.size(); i++) {
            System.out.print(l.get(i));
            if (i == l.size()-1) {
                System.out.println("");
            }
        } int i = 0; int i = 0; i 0 i < l.size() i l.size() l.size l i++ i++ i {
            System.out.print(l.get(i));
            if (i == l.size()-1) {
                System.out.println("");
            }
        } {
            System.out.print(l.get(i));
            if (i == l.size()-1) {
                System.out.println("");
            }
        } System.out.print(l.get(i)) System.out.print System.out System System.out l.get(i) l.get l i if (i == l.size()-1) {
                System.out.println("");
            } i == l.size()-1 i l.size()-1 l.size() l.size l 1 {
                System.out.println("");
            } System.out.println("") System.out.println System.out System System.out "" sc.close() sc.close sc String[] args args
/*
* @Author Silviase(@silviasetitech)
* For ProCon
*/

import java.util.*;
import java.lang.*;
import java.math.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int len = sc.nextInt();
        List l = new ArrayList<String>();
        for (int i = 0; i < n; i++) {
            String tmp = sc.next();
            l.add(tmp);
        }
        Collections.sort(l);
        for (int i = 0; i < l.size(); i++) {
            System.out.print(l.get(i));
            if (i == l.size()-1) {
                System.out.println("");
            }
        }

        sc.close();
    }

}



