#include <bits/stdc++.h>
using namespace std;
void RI() {}
template <typename... T>
void RI(int& head, T&... tail) {
  scanf("%d", &head);
  RI(tail...);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  RI(n);
  cout << "YES" << endl;
  while (n--) {
    int x1, y1, x2, y2;
    RI(x1, y1, x2, y2);
    cout << (((x1 & 1) << 1) + (y1 & 1) + 1) << endl;
  }
  return 0;
}
