import java.util.*;

public class Solution {
    public String PrintMinNumber(int [] num) {
        StringBuilder sb = new StringBuilder();
        
        String[] arr = new String[num.length];
        for (int i = 0; i < num.length; i++) {
            arr[i] = Integer.toString(num[i]);
        }

        Arrays.sort(arr, new Comparator<String>() {
            @Override
            public int compare(String s1, String s2) {
                String c1 = s1 + s2;
                String c2 = s2 + s1;
                return c1.compareTo(c2);
            }
        });

        for (String s: arr) {
            sb.append(s);
        }

        return sb.toString();
    }
}