#include <bits/stdc++.h>
using namespace std;
template <class P, class Q>
void smin(P &a, Q b) {
  if (b < a) a = b;
}
template <class P, class Q>
void smax(P &a, Q b) {
  if (b > a) a = b;
}
template <class P, class Q>
bool in(const P &a, const Q &b) {
  return a.find(b) != a.end();
}
int mod2(int x) { return ((x % 2) + 2) % 2; }
int color(int x, int y) { return mod2(x) * 2 + mod2(y) + 1; }
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  cout << "YES" << endl;
  for (int i = (0); i < int(n); ++i) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << color(a, b) << endl;
  }
  return 0;
}
