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