#include <bits/stdc++.h>
const int nmax = 500000;
int ans[nmax + 5];
int main() {
  int n, i, j, x1, y1, x2, y2;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    ans[i] = (((x2 % 2) + 2) % 2) * 2 + ((y2 % 2) + 2) % 2 + 1;
  }
  printf("YES\n");
  for (i = 1; i <= n; i++) printf("%d\n", ans[i]);
  return 0;
}
