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[] sl = new String[N];
   for(int i =0;i<N;i++) sl[i] = sc.next();
   
   Arrays.sort(sl);
   StringBuilder sb = new StringBuilder();
   for(int i=0;i<N;i++) sb.append(sl[i]);
   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[] sl = new String[N];
   for(int i =0;i<N;i++) sl[i] = sc.next();
   
   Arrays.sort(sl);
   StringBuilder sb = new StringBuilder();
   for(int i=0;i<N;i++) sb.append(sl[i]);
   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[] sl = new String[N];
   for(int i =0;i<N;i++) sl[i] = sc.next();
   
   Arrays.sort(sl);
   StringBuilder sb = new StringBuilder();
   for(int i=0;i<N;i++) sb.append(sl[i]);
   System.out.println(sb.toString());
 } main {
   Scanner sc = new Scanner(System.in);

   int N = sc.nextInt();
   int L = sc.nextInt();
   String[] sl = new String[N];
   for(int i =0;i<N;i++) sl[i] = sc.next();
   
   Arrays.sort(sl);
   StringBuilder sb = new StringBuilder();
   for(int i=0;i<N;i++) sb.append(sl[i]);
   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[] sl = new String[N]; sl new String[N] N for(int i =0;i<N;i++) sl[i] = sc.next(); int i =0; int i =0; i 0 i<N i N i++ i++ i sl[i] = sc.next(); sl[i] = sc.next() sl[i] sl i sc.next() sc.next sc Arrays.sort(sl) Arrays.sort Arrays sl StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i=0;i<N;i++) sb.append(sl[i]); int i=0; int i=0; i 0 i<N i N i++ i++ i sb.append(sl[i]); sb.append(sl[i]) sb.append sb sl[i] sl i 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[] sl = new String[N];
   for(int i =0;i<N;i++) sl[i] = sc.next();
   
   Arrays.sort(sl);
   StringBuilder sb = new StringBuilder();
   for(int i=0;i<N;i++) sb.append(sl[i]);
   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[] sl = new String[N];
   for(int i =0;i<N;i++) sl[i] = sc.next();
   
   Arrays.sort(sl);
   StringBuilder sb = new StringBuilder();
   for(int i=0;i<N;i++) sb.append(sl[i]);
   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[] sl = new String[N];
   for(int i =0;i<N;i++) sl[i] = sc.next();
   
   Arrays.sort(sl);
   StringBuilder sb = new StringBuilder();
   for(int i=0;i<N;i++) sb.append(sl[i]);
   System.out.println(sb.toString());
 }
}