#include <bits/stdc++.h>
using namespace std;
struct Rectangle {
  int l, d, r, u;
};
const int maxn = 500000;
int n;
Rectangle rt[maxn];
int ans[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> rt[i].l >> rt[i].d >> rt[i].r >> rt[i].u;
  for (int i = 0; i < n; i++) ans[i] = (rt[i].l & 1) * 2 + (rt[i].d & 1);
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) cout << ans[i] + 1 << endl;
  return 0;
}
