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