#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
const int INF = 1e9 + 7;
int m, n;
int main() {
  scanf("%d", &n);
  cout << "YES" << '\n';
  for (int i = 1; i <= n; i++) {
    int x, y, xx, yy;
    scanf("%d%d%d%d", &x, &y, &xx, &yy);
    int cur = 1;
    if (x & 1) cur++;
    if (y & 1) cur += 2;
    cout << cur << '\n';
  }
  return 0;
}
