#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int x[N], y[N];
int main() {
  int n, a, b;
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; ++i) scanf("%d %d %d %d", &x[i], &y[i], &a, &b);
    puts("YES");
    for (int i = 1; i <= n; ++i) {
      if (x[i] & 1 && y[i] & 1)
        puts("1");
      else if (x[i] & 1 && !(y[i] & 1))
        puts("2");
      else if (!(x[i] & 1) && y[i] & 1)
        puts("3");
      else
        puts("4");
    }
  }
  return 0;
}
