#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  cout << "YES" << endl;
  int x1, y1, x2, y2;
  for (int i = 0; i < n; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    int c = 1 + (x1 % 2 != 0) * 2 + (y1 % 2 != 0);
    cout << c << endl;
  }
}
