#include <bits/stdc++.h>
using namespace std;
const int INF = (int)(1e9 + 1337);
const long long LINF = (long long)(4e18);
const double EPS = 1e-11;
const int MOD = 1000000007;
const int MAXN = 100005;
int n;
void solve() {
  printf("YES\n");
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    int c = ((((x1 + INF) & 1) << 1) | ((y1 + INF) & 1)) + 1;
    printf("%d\n", c);
  }
}
int main() {
  srand(3333);
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
