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