#include <bits/stdc++.h>
#pragma gcc optimize("ofast")
using namespace std;
long long modexp(long long a, long long b, long long m) {
  long long r = 1;
  a = a % m;
  while (b > 0) {
    if (b & 1) r = (r * a) % m;
    b = b / 2;
    a = (a * a) % m;
  }
  return r % m;
}
int main() {
  ios_base::sync_with_stdio(0);
  long long n;
  cin >> n;
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    long long x;
    long long y;
    cin >> x >> y >> x >> y;
    cout << 2 * (x & 1) + (y & 1) + 1 << '\n';
  }
  return 0;
}
