#include <bits/stdc++.h>
using namespace std;
int n, A, B, C, D, Col[500010];
inline int gcd(int x, int y) {
  if (!y) return x;
  return gcd(y, x % y);
}
inline void read(int &x) {
  char ch;
  int N = 1;
  while ((ch = getchar()) && (!((ch >= '0') && (ch <= '9'))) && (!(ch == '-')))
    ;
  if ((ch == '-')) {
    N = -1;
    while ((ch = getchar()) && (!((ch >= '0') && (ch <= '9'))))
      ;
  }
  x = ch - 48;
  while ((ch = getchar()) && (((ch >= '0') && (ch <= '9'))))
    x = x * 10 + ch - 48;
  x *= N;
}
int main() {
  read(n);
  for (int i = 1; i <= n; i++) {
    read(A);
    read(B);
    read(C);
    read(D);
    if ((A & 1) && (B & 1))
      Col[i] = 1;
    else if ((A & 1) && (!(B & 1)))
      Col[i] = 2;
    else if ((!(A & 1)) && (B & 1))
      Col[i] = 3;
    else
      Col[i] = 4;
  }
  puts("YES");
  for (int i = 1; i <= n; i++) printf("%d\n", Col[i]);
}
