#include <bits/stdc++.h>
using namespace std;
int ans[500010] = {};
int n;
int a, b, c, d;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d%d", &a, &b, &c, &d);
    a = abs(a);
    b = abs(b);
    if (a % 2 == 0 && b % 2 == 0) {
      ans[i] = 1;
    }
    if (a % 2 == 0 && b % 2 == 1) {
      ans[i] = 2;
    }
    if (a % 2 == 1 && b % 2 == 0) {
      ans[i] = 3;
    }
    if (a % 2 == 1 && b % 2 == 1) {
      ans[i] = 4;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    printf("%d\n", ans[i]);
  }
  return 0;
}
