#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, k;
int main() {
  cout << "YES\n";
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    a--, b--;
    cout << 2 * (a & 1) + (b & 1) + 1 << endl;
  }
}
