public void visit(int cur){
		if(cur == n){
			res++;
			return;
		}
		for(int i = 0; i < n; i++){
			if(!col[i] && !xiel[cur + i] && !xier[cur - i + n]){
				pos[cur] = i;
				col[i] = true;
				xiel[cur + i] = true;
				xier[cur - i + n] = true;
				visit(cur+1);
				col[i] = false;
				xiel[cur + i] = false;
				xier[cur - i + n] = false;
			}
		}
	}