#include <bits/stdc++.h>
using namespace std;
void solve(int n) {
  vector<int> x1(n), x2(n), y1(n), y2(n);
  for (int i = 0; i < int(n); ++i) {
    cin >> x1[i] >> y1[i] >> x2[i] >> y2[i];
  }
  cout << "YES\n";
  for (int i = 0; i < int(n); ++i) {
    int xx = (x1[i] % 2 == 0 ? 0 : 1);
    int yy = (y1[i] % 2 == 0 ? 0 : 1);
    int color = 1 + xx + yy * 2;
    cout << color << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  while (cin >> n) solve(n);
}
