#include <bits/stdc++.h>
using namespace std;
vector<int> G[500005];
int n, m, xi[500005], yi[500005], xj[500005], yj[500005], col[500005], c[15],
    a[500005];
void dfs(int t) {
  int i;
  memset(c, 0, sizeof(c));
  for (i = 0; i < G[t].size(); i++)
    if (col[G[t][i]]) c[col[G[t][i]]] = 1;
  for (i = 1; i <= 4; i++)
    if (!c[i]) break;
  col[t] = i;
  for (i = 0; i < G[t].size(); i++)
    if (!col[G[t][i]]) dfs(G[t][i]);
}
int main() {
  int i, j;
  srand(time(NULL));
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d %d %d %d", &xi[i], &yi[i], &xj[i], &yj[i]);
  printf("YES\n");
  for (i = 1; i <= n; i++) {
    xi[i] = abs(xi[i]);
    yi[i] = abs(yi[i]);
    if (xi[i] % 2 == 0 && yi[i] % 2 == 0) col[i] = 1;
    if (xi[i] % 2 == 1 && yi[i] % 2 == 1) col[i] = 2;
    if (xi[i] % 2 == 0 && yi[i] % 2 == 1) col[i] = 3;
    if (xi[i] % 2 == 1 && yi[i] % 2 == 0) col[i] = 4;
    printf("%d\n", col[i]);
  }
  return 0;
}
