#include <bits/stdc++.h>
using namespace std;
int i, j, n, m, a, b, c, d, op, maxi, mini, mij, ls, ld, ul, timp, k,
    cul[1000005];
string s, t;
int f[1000005], k1, k2, k3;
vector<int> v[1000005];
char ch;
void go(int nod, int tata, int parinte) {
  f[nod] = parinte;
  if (cul[nod] != cul[tata] && tata != parinte) {
    if (parinte == 1) {
      if (k1 == 0) a = nod, b = tata;
      k1 = 1;
    }
    if (parinte == a) k2 = 1;
    if (parinte == b) k3 = 1;
  }
  for (int i = 0; i < v[nod].size(); i++)
    if (f[v[nod][i]] != parinte) go(v[nod][i], nod, parinte);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  cout << "YES\n";
  for (i = 1; i <= n; i++) {
    cin >> a >> b >> c >> d;
    a = abs(a);
    b = abs(b);
    cout << a % 2 * 2 + b % 2 + 1 << '\n';
  }
  return 0;
}
