private static void solve(int[] moves, int k) {
		if (k==9) {
			if (isTwelve(clocks)) {
				int val = 0;
				for (int i=0; i<9; i++)
					val += moves[i];
				if (bestMovesVal == 0 || val < bestMovesVal) {
					bestMovesVal = val;
					for (int i=0; i<9; i++)
						bestMoves[i] = moves[i];
				}
			}
			return;
		}
		
		for (int i=3; i>=0; i--) {
			moves[k] = i;
			for (int j=0; j<9; j++)
				clocks[j] += i * moveArr[k][j];
			solve(moves, k+1);
			for (int j=0; j<9; j++)
				clocks[j] -= i * moveArr[k][j];
		}
	}