#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  cout << "YES"
       << "\n";
  for (int i = 0; i < n; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cout << 2 * (x1 & 1) + (y1 & 1) + 1 << "\n";
  }
  return 0;
}
