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