#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int n;
int x[MAXN][2], y[MAXN][2];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d%d%d", &x[i][0], &y[i][0], &x[i][1], &y[i][1]);
  }
  printf("YES\n");
  for (int i = 0; i < n; ++i) {
    printf("%d\n", 2 * (int)abs(x[i][0] % 2) + (int)abs(y[i][0] % 2) + 1);
  }
  return 0;
}
