#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
const int N = 1e6;
int arr[N];
int main() {
  int n;
  scanf("%d", &n);
  printf("YES\n");
  for (int i = 0; i < n; ++i) {
    int x1, y1, x2, y2;
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    int left = min(x1, x2);
    int up = min(y1, y2);
    int color = (left & 1) + (up & 1) * 2 + 1;
    printf("%d\n", color);
  }
  return 0;
}
