#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  printf("YES\n");
  for (int i = 1; i <= n; i++) {
    int x, y;
    int a, b;
    scanf("%d%d%d%d", &x, &y, &a, &b);
    if ((x & 1) && (y & 1)) cout << 1 << endl;
    if ((x & 1) && !(y & 1)) cout << 2 << endl;
    if (!(x & 1) && !(y & 1)) cout << 3 << endl;
    if (!(x & 1) && (y & 1)) cout << 4 << endl;
  }
}
