#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y, x1, y1;
  cin >> n;
  cout << "YES" << endl;
  while (n--) {
    cin >> x >> y >> x1 >> y1;
    cout << (x & 1 ? 0 : 1) + (y & 1 ? 0 : 2) + 1 << endl;
  }
}
