#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e5 + 21, inf = 1e18 + 21, LG = 20;
int n;
int x, y;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  cout << "YES" << '\n';
  for (int i = 0; i < n; i++) {
    cin >> x >> x >> x >> y;
    cout << 2 * ((((y % 2) + 2) % 2) + (((x % 2) + 2) % 2)) + 1 << '\n';
  }
  return 0;
}
