#include <bits/stdc++.h>
using namespace std;
int c[2][2];
void init() {
  c[0][0] = 1;
  c[0][1] = 2;
  c[1][0] = 3;
  c[1][1] = 4;
}
int x[500500], y[500500];
int main() {
  int n;
  init();
  scanf("%d", &n);
  int y1, y2, x1, x2;
  printf("YES\n");
  for (int i = 0; i < int(n); i++) {
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    x[i] = min(x1, x2);
    y[i] = min(y1, y2);
  }
  for (int i = 0; i < int(n); i++)
    printf("%d\n", c[(x[i] % 2 + 2) % 2][(y[i] % 2 + 2) % 2]);
}
