#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, n;
  cin >> n;
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    cin >> a >> b >> c >> d;
    if (a % 2 == 0) {
      if (b % 2 == 0) {
        cout << 1 << endl;
      } else {
        cout << 3 << endl;
      }
    } else {
      if (b % 2 == 0) {
        cout << 2 << endl;
      } else {
        cout << 4 << endl;
      }
    }
  }
}
