import java.util.Scanner;
import java.util.Arrays;

public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int N = scan.nextInt();
	int L = scan.nextInt();

	String[] s_ = new String[N];
	for(int i = 0; i < N; i++){
	    s_[i] = scan.next();
	}

	Arrays.sort(s_);

	for(int i = 0; i < N; i++){
	    System.out.print(s_[i]);
	}
	System.out.println();
    }
}
	 import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int N = scan.nextInt();
	int L = scan.nextInt();

	String[] s_ = new String[N];
	for(int i = 0; i < N; i++){
	    s_[i] = scan.next();
	}

	Arrays.sort(s_);

	for(int i = 0; i < N; i++){
	    System.out.print(s_[i]);
	}
	System.out.println();
    }
} Main public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int N = scan.nextInt();
	int L = scan.nextInt();

	String[] s_ = new String[N];
	for(int i = 0; i < N; i++){
	    s_[i] = scan.next();
	}

	Arrays.sort(s_);

	for(int i = 0; i < N; i++){
	    System.out.print(s_[i]);
	}
	System.out.println();
    } main {
	Scanner scan = new Scanner(System.in);

	int N = scan.nextInt();
	int L = scan.nextInt();

	String[] s_ = new String[N];
	for(int i = 0; i < N; i++){
	    s_[i] = scan.next();
	}

	Arrays.sort(s_);

	for(int i = 0; i < N; i++){
	    System.out.print(s_[i]);
	}
	System.out.println();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int L = scan.nextInt(); L scan.nextInt() scan.nextInt scan String[] s_ = new String[N]; s_ new String[N] N for(int i = 0; i < N; i++){
	    s_[i] = scan.next();
	} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
	    s_[i] = scan.next();
	} {
	    s_[i] = scan.next();
	} s_[i] = scan.next() s_[i] s_ i scan.next() scan.next scan Arrays.sort(s_) Arrays.sort Arrays s_ for(int i = 0; i < N; i++){
	    System.out.print(s_[i]);
	} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
	    System.out.print(s_[i]);
	} {
	    System.out.print(s_[i]);
	} System.out.print(s_[i]) System.out.print System.out System System.out s_[i] s_ i System.out.println() System.out.println System.out System System.out String[] args args public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int N = scan.nextInt();
	int L = scan.nextInt();

	String[] s_ = new String[N];
	for(int i = 0; i < N; i++){
	    s_[i] = scan.next();
	}

	Arrays.sort(s_);

	for(int i = 0; i < N; i++){
	    System.out.print(s_[i]);
	}
	System.out.println();
    }
} public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int N = scan.nextInt();
	int L = scan.nextInt();

	String[] s_ = new String[N];
	for(int i = 0; i < N; i++){
	    s_[i] = scan.next();
	}

	Arrays.sort(s_);

	for(int i = 0; i < N; i++){
	    System.out.print(s_[i]);
	}
	System.out.println();
    }
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int N = scan.nextInt();
	int L = scan.nextInt();

	String[] s_ = new String[N];
	for(int i = 0; i < N; i++){
	    s_[i] = scan.next();
	}

	Arrays.sort(s_);

	for(int i = 0; i < N; i++){
	    System.out.print(s_[i]);
	}
	System.out.println();
    }
}
	
