#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > ma[20005];
int main() {
  int n;
  while (cin >> n) {
    cout << "YES" << endl;
    while (n--) {
      int a, b, c, d;
      cin >> a >> b >> c >> d;
      if (a > c) {
        swap(b, d);
        swap(a, c);
      }
      if (a % 2 && b % 2)
        cout << 1 << endl;
      else if (a % 2 && b % 2 == 0)
        cout << 2 << endl;
      else if (a % 2 == 0 && b % 2)
        cout << 3 << endl;
      else
        cout << 4 << endl;
    }
  }
}
