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