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