#include <bits/stdc++.h>
using namespace std;
void Get_Val(int &Ret) {
  Ret = 0;
  char ch;
  while (ch = getchar(), ch > '9' || ch < '0')
    ;
  do {
    (Ret *= 10) += ch - '0';
  } while (ch = getchar(), ch >= '0' && ch <= '9');
}
int main() {
  int N, a, b, c, d;
  printf("YES\n");
  Get_Val(N);
  while (N--) {
    scanf("%d%d%d%d", &a, &b, &c, &d);
    a += 1000000000, b += 1000000000, c += 1000000000, d += 1000000000;
    printf("%d\n", ((a & 1) << 1) + (b & 1) + 1);
  }
  return 0;
}
