#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y, z, t;
  cin >> n;
  cout << "YES" << '\n';
  for (int i = 0; i < n; i++) {
    cin >> x >> y >> z >> t;
    cout << (abs(x) % 2) * 2 + (abs(y) % 2) + 1 << endl;
  }
  return 0;
}
