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 ar[]=new String[n];
		for(int i=0;i<n;i++)
		ar[i]=sc.next();
		Arrays.sort(ar);
		StringBuilder sb=new StringBuilder();
		for(String s:ar)
		sb.append(s);
		System.out.println(sb.toString());
	}
} 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 ar[]=new String[n];
		for(int i=0;i<n;i++)
		ar[i]=sc.next();
		Arrays.sort(ar);
		StringBuilder sb=new StringBuilder();
		for(String s:ar)
		sb.append(s);
		System.out.println(sb.toString());
	}
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int l=sc.nextInt();
		String ar[]=new String[n];
		for(int i=0;i<n;i++)
		ar[i]=sc.next();
		Arrays.sort(ar);
		StringBuilder sb=new StringBuilder();
		for(String s:ar)
		sb.append(s);
		System.out.println(sb.toString());
	} main {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int l=sc.nextInt();
		String ar[]=new String[n];
		for(int i=0;i<n;i++)
		ar[i]=sc.next();
		Arrays.sort(ar);
		StringBuilder sb=new StringBuilder();
		for(String s:ar)
		sb.append(s);
		System.out.println(sb.toString());
	} 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 ar[]=new String[n]; ar new String[n] n for(int i=0;i<n;i++)
		ar[i]=sc.next(); int i=0; int i=0; i 0 i<n i n i++ i++ i ar[i]=sc.next(); ar[i]=sc.next() ar[i] ar i sc.next() sc.next sc Arrays.sort(ar) Arrays.sort Arrays ar StringBuilder sb=new StringBuilder(); sb new StringBuilder() for(String s:ar)
		sb.append(s); String s ar sb.append(s); sb.append(s) sb.append sb s System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb 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 ar[]=new String[n];
		for(int i=0;i<n;i++)
		ar[i]=sc.next();
		Arrays.sort(ar);
		StringBuilder sb=new StringBuilder();
		for(String s:ar)
		sb.append(s);
		System.out.println(sb.toString());
	}
} public class Main
{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int l=sc.nextInt();
		String ar[]=new String[n];
		for(int i=0;i<n;i++)
		ar[i]=sc.next();
		Arrays.sort(ar);
		StringBuilder sb=new StringBuilder();
		for(String s:ar)
		sb.append(s);
		System.out.println(sb.toString());
	}
} 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 ar[]=new String[n];
		for(int i=0;i<n;i++)
		ar[i]=sc.next();
		Arrays.sort(ar);
		StringBuilder sb=new StringBuilder();
		for(String s:ar)
		sb.append(s);
		System.out.println(sb.toString());
	}
}
