#include <bits/stdc++.h>
using namespace std;
const int N = 5e5;
struct rect {
  int x1, y1, x2, y2;
  rect(int x1 = 0, int y1 = 0, int x2 = 0, int y2 = 0)
      : x1(x1), y1(y1), x2(x2), y2(y2) {}
} r[N];
int col[N];
map<int, vector<int> > rx, ry;
int n;
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(0);
  scanf("%d", &n);
  for (int(i) = (0); (i) < (n); (i)++) {
    int a, b, c, d;
    scanf("%d %d %d %d", &a, &b, &c, &d);
    if (a % 2 == 0) {
      if (b % 2 == 0) {
        col[i] = 1;
      } else {
        col[i] = 2;
      }
    } else {
      if (b % 2 == 0) {
        col[i] = 3;
      } else {
        col[i] = 4;
      }
    }
  }
  printf("YES\n");
  for (int(i) = (0); (i) < (n); (i)++) {
    printf("%d\n", col[i]);
  }
  return 0;
}
