#include <bits/stdc++.h>
using namespace std;
int x[500010], y[500010];
int main() {
  int n, a, b;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d %d %d %d", &x[i], &y[i], &a, &b);
    x[i] = abs(x[i]);
    y[i] = abs(y[i]);
  }
  printf("YES\n");
  for (int i = 0; i < n; ++i) {
    if (x[i] % 2 == 0 && y[i] % 2 == 1)
      printf("1\n");
    else if (x[i] % 2 == 1 && y[i] % 2 == 1)
      printf("2\n");
    else if (x[i] % 2 == 1 && y[i] % 2 == 0)
      printf("3\n");
    else
      printf("4\n");
  }
  return 0;
}
