#include <bits/stdc++.h>
using namespace std;
int quick_pow(int a, int b, int MOD) {
  a %= MOD;
  int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % MOD;
    b /= 2;
    a = (a * a) % MOD;
  }
  return res;
}
const int maxn = 200000 + 10;
const int MOD = 1e9 + 7;
int main() {
  int i, j, n;
  while (scanf("%d", &n) != EOF) {
    puts("YES");
    for (i = 1; i <= n; i++) {
      int x, y;
      scanf("%d%d%*d%*d", &x, &y);
      printf("%d\n", 2 * (x & 1) + (y & 1) + 1);
    }
  }
  return 0;
}
