#include <bits/stdc++.h>
using namespace std;
template <class X, class Y>
void amax(X& x, const Y& y) {
  if (x < y) x = y;
}
template <class X, class Y>
void amin(X& x, const Y& y) {
  if (x > y) x = y;
}
const int INF = 1e9 + 10;
const long long INFL = 1e18 + 10;
int n;
void process() {
  cin >> n;
  cout << "YES" << '\n';
  for (int i = 1; i <= n; i++) {
    int u, v, x, y;
    cin >> u >> v >> x >> y;
    cout << (2 * (u & 1) + (v & 1)) + 1 << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  process();
}
