#include <bits/stdc++.h>
int c[500005];
struct re {
  int x1;
  int x2;
  int y1;
  int y2;
} rec[500005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d%d%d", &rec[i].x1, &rec[i].y1, &rec[i].x2, &rec[i].y2);
  }
  printf("YES\n");
  for (int i = 0; i < n; i++) {
    if (rec[i].x1 < 0) {
      rec[i].x1 = -rec[i].x1;
    }
    if (rec[i].y1 < 0) {
      rec[i].y1 = -rec[i].y1;
    }
    if (rec[i].x1 % 2 == 1 && rec[i].y1 % 2 == 1) {
      printf("1\n");
    } else if (rec[i].x1 % 2 == 1 && rec[i].y1 % 2 == 0) {
      printf("2\n");
    } else if (rec[i].x1 % 2 == 0 && rec[i].y1 % 2 == 1) {
      printf("3\n");
    } else {
      printf("4\n");
    }
  }
  return 0;
}
