#include <bits/stdc++.h>
using namespace std;
const int MAX_N = (int)1e5 + 123;
const int inf = (int)1e9 + 7;
int main() {
  int n;
  cin >> n;
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    int x, y, x2, y2;
    cin >> x >> y >> x2 >> y2;
    x = (x % 2 + 2) % 2;
    y = (y % 2 + 2) % 2;
    cout << x * 2 + y + 1 << endl;
  }
}
