import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		List<String> s = new ArrayList<String>();

		for (int i = 0; i < n; i++) {
			s.add(scan.next());
		}
		s.sort(Comparator.naturalOrder());
		System.out.println(String.join("", s));
	}

} import java.util.ArrayList; ArrayList java.util import java.util.Comparator; Comparator java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		List<String> s = new ArrayList<String>();

		for (int i = 0; i < n; i++) {
			s.add(scan.next());
		}
		s.sort(Comparator.naturalOrder());
		System.out.println(String.join("", s));
	}

} Main public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		List<String> s = new ArrayList<String>();

		for (int i = 0; i < n; i++) {
			s.add(scan.next());
		}
		s.sort(Comparator.naturalOrder());
		System.out.println(String.join("", s));
	} main {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		List<String> s = new ArrayList<String>();

		for (int i = 0; i < n; i++) {
			s.add(scan.next());
		}
		s.sort(Comparator.naturalOrder());
		System.out.println(String.join("", s));
	} @SuppressWarnings("resource")
		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 List<String> s = new ArrayList<String>(); s new ArrayList<String>() for (int i = 0; i < n; i++) {
			s.add(scan.next());
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			s.add(scan.next());
		} {
			s.add(scan.next());
		} s.add(scan.next()) s.add s scan.next() scan.next scan s.sort(Comparator.naturalOrder()) s.sort s Comparator.naturalOrder() Comparator.naturalOrder Comparator System.out.println(String.join("", s)) System.out.println System.out System System.out String.join("", s) String.join String "" s String[] args args public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		List<String> s = new ArrayList<String>();

		for (int i = 0; i < n; i++) {
			s.add(scan.next());
		}
		s.sort(Comparator.naturalOrder());
		System.out.println(String.join("", s));
	}

} public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		List<String> s = new ArrayList<String>();

		for (int i = 0; i < n; i++) {
			s.add(scan.next());
		}
		s.sort(Comparator.naturalOrder());
		System.out.println(String.join("", s));
	}

} Main
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();
		List<String> s = new ArrayList<String>();

		for (int i = 0; i < n; i++) {
			s.add(scan.next());
		}
		s.sort(Comparator.naturalOrder());
		System.out.println(String.join("", s));
	}

}
