#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  int n, x, y, x1, y1;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y >> x1 >> y1;
    if (abs(x) % 2 == 0 && abs(y) % 2 == 0)
      v.push_back(1);
    else if (abs(x) % 2 == 0 && abs(y) % 2 == 1)
      v.push_back(2);
    else if (abs(x) % 2 == 1 && abs(y) % 2 == 0)
      v.push_back(3);
    else if (abs(x) % 2 == 1 && abs(y) % 2 == 1)
      v.push_back(4);
  }
  cout << "YES" << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << endl;
  return 0;
}
