#include <bits/stdc++.h>
using namespace std;
int n, color[100005];
pair<int, int> beda[100005];
vector<vector<int> > adj;
bool flag[100005];
set<int> flagwarna;
int idx1, idx2;
bool cek2(int idx) {
  if (adj[idx].size() == 1) return true;
  flag[idx] = true;
  bool ans = true;
  for (int i = 0; i < (int)adj[idx].size(); i++) {
    if (!flag[adj[idx][i]]) {
      if (color[idx] != color[adj[idx][i]])
        return false;
      else
        ans = ans & cek2(adj[idx][i]);
    }
  }
  return ans;
  flag[idx] = false;
}
bool cek(int idx) {
  for (int i = 0; i < (int)adj[idx].size(); i++) {
    if (cek2(adj[idx][i]) == false) {
      return false;
    }
  }
  return true;
}
void cek3(int idx) {
  flag[idx] = true;
  for (int i = 0; i < (int)adj[idx].size(); i++) {
    if (!flag[adj[idx][i]]) {
      if (color[idx] != color[adj[idx][i]]) {
        idx1 = idx;
        idx2 = adj[idx][i];
        return;
      } else
        cek3(adj[idx][i]);
    }
  }
}
bool cmp(pair<int, int> a, pair<int, int> b) {
  if (b.second == a.second) {
    return a.first < b.first;
  } else
    return a.second < b.second;
}
int main() {
  scanf("%d", &n);
  printf("YES\n");
  while (n--) {
    int aa, bb, cc, dd;
    scanf("%d%d%d%d", &aa, &bb, &cc, &dd);
    int t;
    bb = abs(bb);
    cc = abs(cc);
    if (cc % 2 == 0 && bb % 2 == 0)
      t = 3;
    else if (cc % 2 == 0 && bb % 2 == 1)
      t = 2;
    else if (cc % 2 == 1 && bb % 2 == 0)
      t = 1;
    else
      t = 4;
    printf("%d\n", t);
  }
  return 0;
}
