#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:216000000")
using namespace std;
const long long MAX = numeric_limits<long long>::max();
const long long MIN = numeric_limits<long long>::min();
const double PI = 3.1415926535;
const long long MOD = 1000000007;
template <class T>
ostream& operator<<(ostream& out, vector<T>& v) {
  for (int i = 0; i < v.size(); ++i) out << v[i] << " ";
  out << endl;
  return out;
}
template <class T>
istream& operator>>(istream& in, vector<T>& v) {
  for (int i = 0; i < v.size(); ++i) in >> v[i];
  return in;
}
template <class R, class L>
istream& operator>>(istream& in, pair<R, L>& p) {
  in >> p.first >> p.second;
  return in;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long ceil(long long a, long long b) {
  if (a % b) return a / b + 1;
  return a / b;
}
int ans;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  cout << "YES" << endl;
  for (int i = 0; i < n; ++i) {
    int x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cout << abs(x1) % 2 + 2 * (abs(y1) % 2) + 1 << endl;
  }
}
