#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  const int mod = 1000000007;
  int n;
  cin >> n;
  cout << "YES\n" << endl;
  while (n--) {
    int x, y, xx, yy;
    cin >> x >> y >> xx >> yy;
    if (x % 2 && y % 2)
      cout << 1 << endl;
    else if (x % 2)
      cout << 2 << endl;
    else if (y % 2)
      cout << 3 << endl;
    else
      cout << 4 << endl;
  }
  return 0;
}
