import java.util.*;
class Main{
  public static void main(String[]a){
    Scanner s=new Scanner(System.in);
    int n=s.nextInt();
    int i=s.nextInt();
    a=new String[n];
    for(i=0;i<n;i++)a[i]=s.next();
    Arrays.sort(a);
    for(i=0;i<n;i++)System.out.print(a[i]);
  }
} import java.util.*; util.* java class Main{
  public static void main(String[]a){
    Scanner s=new Scanner(System.in);
    int n=s.nextInt();
    int i=s.nextInt();
    a=new String[n];
    for(i=0;i<n;i++)a[i]=s.next();
    Arrays.sort(a);
    for(i=0;i<n;i++)System.out.print(a[i]);
  }
} Main public static void main(String[]a){
    Scanner s=new Scanner(System.in);
    int n=s.nextInt();
    int i=s.nextInt();
    a=new String[n];
    for(i=0;i<n;i++)a[i]=s.next();
    Arrays.sort(a);
    for(i=0;i<n;i++)System.out.print(a[i]);
  } main {
    Scanner s=new Scanner(System.in);
    int n=s.nextInt();
    int i=s.nextInt();
    a=new String[n];
    for(i=0;i<n;i++)a[i]=s.next();
    Arrays.sort(a);
    for(i=0;i<n;i++)System.out.print(a[i]);
  } Scanner s=new Scanner(System.in); s new Scanner(System.in) int n=s.nextInt(); n s.nextInt() s.nextInt s int i=s.nextInt(); i s.nextInt() s.nextInt s a=new String[n] a new String[n] n for(i=0;i<n;i++)a[i]=s.next(); i=0; i=0 i 0 i<n i n i++ i++ i a[i]=s.next(); a[i]=s.next() a[i] a i s.next() s.next s Arrays.sort(a) Arrays.sort Arrays a for(i=0;i<n;i++)System.out.print(a[i]); i=0; i=0 i 0 i<n i n i++ i++ i System.out.print(a[i]); System.out.print(a[i]) System.out.print System.out System System.out a[i] a i String[]a a
import java.util.*;
class Main{
  public static void main(String[]a){
    Scanner s=new Scanner(System.in);
    int n=s.nextInt();
    int i=s.nextInt();
    a=new String[n];
    for(i=0;i<n;i++)a[i]=s.next();
    Arrays.sort(a);
    for(i=0;i<n;i++)System.out.print(a[i]);
  }
}