#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    int x, y, x1, y1;
    cin >> x >> y >> x1 >> y1;
    if (abs(x) % 2 == 0 && abs(y) % 2 == 0) {
      cout << 1 << endl;
    } else if (abs(x) % 2 == 1 && abs(y) % 2 == 0) {
      cout << 2 << endl;
    } else if (abs(x) % 2 == 0 && abs(y) % 2 == 1) {
      cout << 3 << endl;
    } else {
      cout << 4 << endl;
    }
  }
  return 0;
}
