#include <bits/stdc++.h>
using namespace std;
struct rect {
  int x1, y1, x2, y2;
};
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<rect> v(n);
  int minx = 1000000000;
  int miny = 1000000000;
  for (int i = 0; i < n; ++i) {
    cin >> v[i].x1 >> v[i].y1 >> v[i].x2 >> v[i].y2;
    minx = min(minx, v[i].x1);
    miny = min(miny, v[i].y1);
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; ++i) {
    int x = (v[i].x1 - minx) % 2;
    int y = (v[i].y1 - miny) % 2;
    if (x == 0 && y == 0) {
      cout << 1;
    } else if (x == 1 && y == 0) {
      cout << 2;
    } else if (x == 0 && y == 1) {
      cout << 3;
    } else {
      cout << 4;
    }
    cout << endl;
  }
  return 0;
}
