import java.util.*;
public class Main {
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt(), b = scan.nextInt();
		ArrayList<String> ABC = new ArrayList<String>();
		String output = "";
		for (int i = 0;  i < a; i++ )
		{
			ABC.add(scan.next());
		}
		
		for (int i = 0; i < a;i++)
		{
			String small = ABC.get(0);
			for (int x = 1; x < ABC.size();x++)
			{
				if (small.compareTo(ABC.get(x)) > 0) small = ABC.get(x);
			}
			output+=small;
			ABC.remove(small);
		}
		System.out.println(output);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt(), b = scan.nextInt();
		ArrayList<String> ABC = new ArrayList<String>();
		String output = "";
		for (int i = 0;  i < a; i++ )
		{
			ABC.add(scan.next());
		}
		
		for (int i = 0; i < a;i++)
		{
			String small = ABC.get(0);
			for (int x = 1; x < ABC.size();x++)
			{
				if (small.compareTo(ABC.get(x)) > 0) small = ABC.get(x);
			}
			output+=small;
			ABC.remove(small);
		}
		System.out.println(output);
	}
} Main public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt(), b = scan.nextInt();
		ArrayList<String> ABC = new ArrayList<String>();
		String output = "";
		for (int i = 0;  i < a; i++ )
		{
			ABC.add(scan.next());
		}
		
		for (int i = 0; i < a;i++)
		{
			String small = ABC.get(0);
			for (int x = 1; x < ABC.size();x++)
			{
				if (small.compareTo(ABC.get(x)) > 0) small = ABC.get(x);
			}
			output+=small;
			ABC.remove(small);
		}
		System.out.println(output);
	} main {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt(), b = scan.nextInt();
		ArrayList<String> ABC = new ArrayList<String>();
		String output = "";
		for (int i = 0;  i < a; i++ )
		{
			ABC.add(scan.next());
		}
		
		for (int i = 0; i < a;i++)
		{
			String small = ABC.get(0);
			for (int x = 1; x < ABC.size();x++)
			{
				if (small.compareTo(ABC.get(x)) > 0) small = ABC.get(x);
			}
			output+=small;
			ABC.remove(small);
		}
		System.out.println(output);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt() a scan.nextInt() scan.nextInt scan b = scan.nextInt(); b scan.nextInt() scan.nextInt scan ArrayList<String> ABC = new ArrayList<String>(); ABC new ArrayList<String>() String output = ""; output "" for (int i = 0;  i < a; i++ )
		{
			ABC.add(scan.next());
		} int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
			ABC.add(scan.next());
		} {
			ABC.add(scan.next());
		} ABC.add(scan.next()) ABC.add ABC scan.next() scan.next scan for (int i = 0; i < a;i++)
		{
			String small = ABC.get(0);
			for (int x = 1; x < ABC.size();x++)
			{
				if (small.compareTo(ABC.get(x)) > 0) small = ABC.get(x);
			}
			output+=small;
			ABC.remove(small);
		} int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
			String small = ABC.get(0);
			for (int x = 1; x < ABC.size();x++)
			{
				if (small.compareTo(ABC.get(x)) > 0) small = ABC.get(x);
			}
			output+=small;
			ABC.remove(small);
		} {
			String small = ABC.get(0);
			for (int x = 1; x < ABC.size();x++)
			{
				if (small.compareTo(ABC.get(x)) > 0) small = ABC.get(x);
			}
			output+=small;
			ABC.remove(small);
		} String small = ABC.get(0); small ABC.get(0) ABC.get ABC 0 for (int x = 1; x < ABC.size();x++)
			{
				if (small.compareTo(ABC.get(x)) > 0) small = ABC.get(x);
			} int x = 1; int x = 1; x 1 x < ABC.size() x ABC.size() ABC.size ABC x++ x++ x {
				if (small.compareTo(ABC.get(x)) > 0) small = ABC.get(x);
			} {
				if (small.compareTo(ABC.get(x)) > 0) small = ABC.get(x);
			} if (small.compareTo(ABC.get(x)) > 0) small = ABC.get(x); small.compareTo(ABC.get(x)) > 0 small.compareTo(ABC.get(x)) small.compareTo small ABC.get(x) ABC.get ABC x 0 small = ABC.get(x) small ABC.get(x) ABC.get ABC x output+=small output small ABC.remove(small) ABC.remove ABC small System.out.println(output) System.out.println System.out System System.out output String[] args args public class Main {
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt(), b = scan.nextInt();
		ArrayList<String> ABC = new ArrayList<String>();
		String output = "";
		for (int i = 0;  i < a; i++ )
		{
			ABC.add(scan.next());
		}
		
		for (int i = 0; i < a;i++)
		{
			String small = ABC.get(0);
			for (int x = 1; x < ABC.size();x++)
			{
				if (small.compareTo(ABC.get(x)) > 0) small = ABC.get(x);
			}
			output+=small;
			ABC.remove(small);
		}
		System.out.println(output);
	}
} public class Main {
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt(), b = scan.nextInt();
		ArrayList<String> ABC = new ArrayList<String>();
		String output = "";
		for (int i = 0;  i < a; i++ )
		{
			ABC.add(scan.next());
		}
		
		for (int i = 0; i < a;i++)
		{
			String small = ABC.get(0);
			for (int x = 1; x < ABC.size();x++)
			{
				if (small.compareTo(ABC.get(x)) > 0) small = ABC.get(x);
			}
			output+=small;
			ABC.remove(small);
		}
		System.out.println(output);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt(), b = scan.nextInt();
		ArrayList<String> ABC = new ArrayList<String>();
		String output = "";
		for (int i = 0;  i < a; i++ )
		{
			ABC.add(scan.next());
		}
		
		for (int i = 0; i < a;i++)
		{
			String small = ABC.get(0);
			for (int x = 1; x < ABC.size();x++)
			{
				if (small.compareTo(ABC.get(x)) > 0) small = ABC.get(x);
			}
			output+=small;
			ABC.remove(small);
		}
		System.out.println(output);
	}
}