import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {

    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        int n = stdin.nextInt();
        int l = stdin.nextInt();
        List<String> s = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            s.add(stdin.next());
        }
        
        String ans = s.stream().sorted().collect(Collectors.joining());
        System.out.println(ans);
    }

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

    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        int n = stdin.nextInt();
        int l = stdin.nextInt();
        List<String> s = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            s.add(stdin.next());
        }
        
        String ans = s.stream().sorted().collect(Collectors.joining());
        System.out.println(ans);
    }

} Main public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        int n = stdin.nextInt();
        int l = stdin.nextInt();
        List<String> s = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            s.add(stdin.next());
        }
        
        String ans = s.stream().sorted().collect(Collectors.joining());
        System.out.println(ans);
    } main {
        Scanner stdin = new Scanner(System.in);
        int n = stdin.nextInt();
        int l = stdin.nextInt();
        List<String> s = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            s.add(stdin.next());
        }
        
        String ans = s.stream().sorted().collect(Collectors.joining());
        System.out.println(ans);
    } Scanner stdin = new Scanner(System.in); stdin new Scanner(System.in) int n = stdin.nextInt(); n stdin.nextInt() stdin.nextInt stdin int l = stdin.nextInt(); l stdin.nextInt() stdin.nextInt stdin List<String> s = new ArrayList<>(); s new ArrayList<>() for (int i = 0; i < n; i++) {
            s.add(stdin.next());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            s.add(stdin.next());
        } {
            s.add(stdin.next());
        } s.add(stdin.next()) s.add s stdin.next() stdin.next stdin String ans = s.stream().sorted().collect(Collectors.joining()); ans s.stream().sorted().collect(Collectors.joining()) s.stream().sorted().collect s.stream().sorted() s.stream().sorted s.stream() s.stream s Collectors.joining() Collectors.joining Collectors System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        int n = stdin.nextInt();
        int l = stdin.nextInt();
        List<String> s = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            s.add(stdin.next());
        }
        
        String ans = s.stream().sorted().collect(Collectors.joining());
        System.out.println(ans);
    }

} public class Main {

    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        int n = stdin.nextInt();
        int l = stdin.nextInt();
        List<String> s = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            s.add(stdin.next());
        }
        
        String ans = s.stream().sorted().collect(Collectors.joining());
        System.out.println(ans);
    }

} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {

    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        int n = stdin.nextInt();
        int l = stdin.nextInt();
        List<String> s = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            s.add(stdin.next());
        }
        
        String ans = s.stream().sorted().collect(Collectors.joining());
        System.out.println(ans);
    }

}
