#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 1e9 + 10;
const long long MOD = 1e9 + 696969;
const long long INF = 1e18;
int n, m, k, a, b, c;
pair<pair<long long, long long>, pair<long long, long long> > rec[1000100];
vector<int> v[1000100];
int col[1000100];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = (1); i <= (n); ++i) {
    cin >> rec[i].first.first >> rec[i].first.second >> rec[i].second.first >>
        rec[i].second.second;
    rec[i].first.first += inf;
    rec[i].first.second += inf;
    if (rec[i].first.first % 2 == 0 && rec[i].first.second % 2 == 0) col[i] = 1;
    if (rec[i].first.first % 2 == 0 && rec[i].first.second % 2 == 1) col[i] = 2;
    if (rec[i].first.first % 2 == 1 && rec[i].first.second % 2 == 0) col[i] = 3;
    if (rec[i].first.first % 2 == 1 && rec[i].first.second % 2 == 1) col[i] = 4;
  }
  cout << "YES\n";
  for (int i = (1); i <= (n); ++i) cout << col[i] << "\n";
}
