#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  int n;
  cin >> n;
  int x1, y1, x2, y2;
  vector<int> ans(n);
  for (ll i = 0, iLen = (n); i < iLen; ++i) {
    cin >> x1 >> y1 >> x2 >> y2;
    ans[i] = ((x1 % 2 + 2) % 2) + ((y1 % 2 + 2) % 2) * 2 + 1;
  }
  cout << "YES\n";
  for (ll i = 0, iLen = (n); i < iLen; ++i) cout << ans[i] << "\n";
}
