#include <bits/stdc++.h>
using namespace std;
int main() {
  printf("YES\n");
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x1, x2, y1, y2;
    scanf("%d %d", &x1, &y1);
    scanf("%d %d", &x2, &y2);
    printf("%d\n", (8 + 2 * (x1 % 2) + y1 % 2) % 4 + 1);
  }
  return 0;
}
