#include <bits/stdc++.h>
using namespace std;
using LD = long double;
using PLL = pair<long long, long long>;
template <class T>
bool power_2(T v) {
  static_assert(std::is_integral<T>::value, "type should be integral");
  return v && !(v & (v - 1));
}
template <class T>
istream& operator>>(istream& st, vector<T>& container) {
  for (auto& u : container) st >> u;
  return st;
}
template <class T, size_t N>
istream& operator>>(istream& st, array<T, N>& container) {
  for (auto& u : container) st >> u;
  return st;
}
template <class T>
ostream& operator<<(ostream& st, const vector<T>& container) {
  for (auto& u : container) st << u << '  ';
  return st;
}
template <class T, class U>
istream& operator>>(istream& st, pair<T, U>& p) {
  st >> p.first >> p.second;
  return st;
}
template <class T, class U>
ostream& operator<<(ostream& st, pair<T, U> p) {
  st << p.first << ' ' << p.second;
  return st;
}
template <class T, class U, class V>
pair<T, U> operator*(pair<T, U> p, V val) {
  return {p.first * val, p.second * val};
}
template <class T, class U, class V>
pair<T, U> operator/(pair<T, U> p, V val) {
  return {p.first / val, p.second / val};
}
template <class T, class U>
pair<T, U> operator-(pair<T, U> a, pair<T, U> b) {
  return {a.first - b.first, a.second - b.second};
}
template <class T, class U>
pair<T, U> operator+(pair<T, U> a, pair<T, U> b) {
  return {a.first + b.first, a.second + b.second};
}
template <class T>
T dotProduct(pair<T, T> a, pair<T, T> b) {
  return a.first * b.first + a.second * b.second;
}
template <class T>
T crossProduct(pair<T, T> a, pair<T, T> b) {
  return a.first * b.second - a.second * b.first;
}
template <class T>
T lengthPow(pair<T, T> a) {
  return a.first * a.first + a.second * a.second;
}
template <class T>
LD length(pair<T, T> a) {
  return sqrt(lengthPow(a));
}
array<int, 5> operator-(array<int, 5> a, array<int, 5> b) {
  for (int i = 0; i < 5; ++i) a[i] -= b[i];
  return a;
}
const int N = 4e4 + 7, inf = 1e9 + 7, MOD = 1e9 + 7;
const long long INF = 2e18 + 7;
const int M = 1 << 16;
const long double PI = acos(-1);
const LD eps = 1e-4;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cout << fixed << setprecision(15);
  int n;
  cin >> n;
  cout << "YES\n";
  while (n--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int x = abs(min(x1, x2));
    int y = abs(min(y1, y2));
    cout << 2 * (x % 2) + y % 2 + 1 << '\n';
  }
  return 0;
}
