public static String permutationToMatrix(final List<Integer> inputPerm) {
        final List<Integer> sorted = new ArrayList<>(inputPerm);
        Collections.sort(sorted);
        
        final StringBuilder sb = new StringBuilder("(");
        for (int i = 0; i < sorted.size(); ++i) {
            if ((i < 9) && (inputPerm.get(i) > 9))
                sb.append(" ");
            sb.append(i + 1);
            if (!Utils.lastForCycle(i, sorted.size()))
                sb.append(", ");
        }
        sb.append(")").append(Utils.NEWLINE);
        sb.append(permutationToString(inputPerm));
        return sb.toString();
    }