#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
const int MOD = 1e9 + 7;
const long long INF64 = 1e18;
const long double EPS = 1e-7;
mt19937 myrand(time(NULL));
const int N = 500 * 1000 + 13;
struct rect {
  int x1, y1, x2, y2, ind;
  rect(int x1, int y1, int x2, int y2, int ind)
      : x1(x1), y1(y1), x2(x2), y2(y2), ind(ind){};
  rect(){};
};
int n;
rect a[N];
bool read() {
  if (scanf("%d", &n) != 1) return 0;
  int x1, y1, x2, y2;
  for (int i = 0; i < (n); i++) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    a[i] = rect(min(x1, x2), min(y1, y2), max(x1, x2), max(y1, y2), i);
  }
  return 1;
}
void solve() {
  printf("YES\n");
  for (int i = 0; i < (n); i++)
    printf("%d\n", 1 + 2 * (a[i].x1 & 1) + (a[i].y1 & 1));
}
int main() {
  while (read()) solve();
  return 0;
}
