private static void permute_tool (List<List<Integer>> ret, ArrayList<Integer> tmp, int num[]) {
    	if (tmp.size() == num.length) {
    		ret.add(new ArrayList<Integer>(tmp));
    		return;
    	}
    	else {
    		for (int i = 0; i < num.length; ++i) {
    			if (tmp.contains(num[i])) continue;
    			else {
    				tmp.add(num[i]);
    				permute_tool(ret, tmp, num);
    				tmp.remove(tmp.size()-1);
    			}
    		}
    	}
    }