@@ -0,0 +1,1121 @@
+import java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0Aimport java.math.BigInteger;%0A%0Apublic class Solution %7B%0A%0A    class StringComparator implements Comparator %7B%0A        public int compare(Object o1, Object o2) %7B%0A            String s1 = (String) o1;%0A            String s2 = (String) o2;%0A            if (s1.length() != s2.length()) %7B%0A                return s1.length() - s2.length();%0A            %7D else %7B%0A                BigInteger i1 = new BigInteger(s1);%0A                BigInteger i2 = new BigInteger(s2);%0A                return i1.compareTo(i2);%0A            %7D%0A        %7D%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int n = in.nextInt();%0A        String%5B%5D unsorted = new String%5Bn%5D;%0A        for(int unsorted_i=0; unsorted_i %3C n; unsorted_i++)%7B%0A            unsorted%5Bunsorted_i%5D = in.next();%0A        %7D%0A        List%3CString%3E list = Arrays.asList(unsorted);%0A        Collections.sort(list, new Solution().new StringComparator());%0A        for (String str : list) %7B%0A            System.out.println(str);%0A        %7D%0A    %7D%0A%7D%0A

Solve big_sorting