#include <bits/stdc++.h>
using namespace std;
const long long N = 5e5 + 7, NS = 2e3 + 7, lg = 20, sq = 550, inf = 1e9 + 7,
                mod = 1e9 + 7, SM = 101;
const long double eps = 1e-9;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  cout << "YES\n";
  for (long long i = 0; i < n; i++) {
    long long x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long cx = abs(x2), cy = abs(y2);
    cout << 2 * (cx % 2) + (cy % 2 + 1) << '\n';
  }
}
