public void tryNext(ArrayList<ArrayList<Integer>> res, int[] num, int level, int[] have, boolean[] used) {
        if(level == num.length) {
            ArrayList<Integer> list = new ArrayList<Integer>();
            for(int i = 0; i < num.length; i++) {
                list.add(have[i]);
            }
            res.add(list);
            return;
        }
        for(int i = 0; i < num.length; i++) {
            if(!used[i]) {
                used[i] = true;
                have[level] = num[i];
                tryNext(res, num, level+1, have, used);
                used[i] = false;
            }
        }
    }