Small is Cute

4.3

3 votes
Easy-Medium
Problem

Problem Statement

As they say, small is cute and beautiful.

Given N distinct positive integers, find the smallest number that can be formed by concatenating all of them.


Input Format

The first line of the input file contains a positive integer N. Then N lines follow.
Each line contains a single positive integer K.

Output Format

Output the smallest possible number that can be formed by concatenating all the numbers.

Constraints

1 ≤ N ≤ 5000
1 ≤ K ≤ 1015

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?