#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 14;
int n;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n;
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    int sx, sy, ex, ey;
    cin >> sx >> sy >> ex >> ey;
    cout << (sx % 2 + 2) % 2 * 2 + (sy % 2 + 2) % 2 + 1 << '\n';
  }
}
