public static void generate(int[] result, int N, ArrayList<String[]> a) {
	      if (result.length == N) {
	         a.add(print(result));
	     }
	     else {
	         for (int i=0; i<result.length; i++) {
	             result[N] = i;
	             if (isConsistent(result, N)) 
	                 generate(result, N+1, a);
	         }
	     }
	 }