#include <bits/stdc++.h>
using namespace std;
long long tou[150001];
long long find(long long k);
int main(void) {
  int a, b;
  int c, d, e, f;
  cin >> a;
  cout << "YES\n";
  for (b = 1; b <= a; b++) {
    cin >> c >> d >> e >> f;
    if ((c % 2 == 0) && (d % 2 == 0)) cout << 1 << "\n";
    if ((c % 2 != 0) && (d % 2 == 0)) cout << 2 << "\n";
    if ((c % 2 == 0) && (d % 2 != 0)) cout << 3 << "\n";
    if ((c % 2 != 0) && (d % 2 != 0)) cout << 4 << "\n";
  }
}
