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