#include <bits/stdc++.h>
using namespace std;
long long n;
void solve() {
  cin >> n;
  long long x, y, a, b;
  cout << "YES\n";
  for (long long i = 1; i <= (n); ++i) {
    cin >> x >> y >> a >> b;
    cout << 2 * (x & 1) + (y & 1) + 1;
    cout << '\n';
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  solve();
  return 0;
}
