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