#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 6;
int c[N];
int get_color(int x1, int y1, int x2, int y2) {
  int x = min(x1, x2);
  int y = min(y1, y2);
  int ans = 0;
  if (x & 1) {
    ans |= 1;
  }
  if (y & 1) {
    ans |= 2;
  }
  return ans;
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    int x1, y1, x2, y2;
    for (int i = 1; i <= n; ++i) {
      scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
      c[i] = get_color(x1, y1, x2, y2);
    }
    puts("YES");
    for (int i = 1; i <= n; ++i) {
      printf("%d\n", c[i] + 1);
    }
  }
  return 0;
}
