#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x1, y1, x2, y2;
  int x;
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 % 2 == 0) {
      if (y1 % 2 == 0)
        x = 1;
      else
        x = 2;
    } else {
      if (y1 % 2 == 0)
        x = 3;
      else
        x = 4;
    }
    cout << x << endl;
  }
  return 0;
}
