#include <bits/stdc++.h>
using namespace std;
const long long maxN = 1e6 + 5;
const long long inf = 1e10;
const long long mod = 1e9 + 7;
long long n;
long long x[maxN], y[maxN], a, b;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> x[i] >> y[i] >> a >> b;
  }
  cout << "YES" << endl;
  for (long long i = 1; i <= n; i++) {
    if (x[i] & 1 && y[i] & 1)
      cout << 1 << endl;
    else if (x[i] & 1 && !(y[i] & 1))
      cout << 2 << endl;
    else if (!(x[i] & 1) && y[i] & 1)
      cout << 3 << endl;
    else
      cout << 4 << endl;
  }
  return 0;
}
