#include <bits/stdc++.h>
const long long INF = 4e18L + 1;
const int IINF = 1e9;
const int limit = 1048576;
using namespace std;
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << '=' << h << endl;
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << '=' << h << ',';
  _dbg(sdbg + 1, a...);
}
int main() {
  cout << "YES\n";
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    x1 += IINF;
    y1 += IINF;
    int k = x1 % 2 + (y1 % 2) * 2 + 1;
    cout << k << "\n";
  }
}
