#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
inline void writeln(long long x) {
  write(x);
  puts("");
}
long long n;
int main() {
  n = read();
  puts("YES");
  for (long long i = 1; i <= n; ++i) {
    long long x = read(), y = read(), ans = 1;
    read(), read();
    if (x & 1) ans += 2;
    if (y & 1) ans++;
    writeln(ans);
  }
}
