#include <bits/stdc++.h>
using namespace std;
const int N = 5 * 1e5 + 5;
int n, vis[N], m = 1e9;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    if ((x1 + m) % 2 && (y1 + m) % 2)
      vis[i] = 1;
    else if ((x1 + m) % 2)
      vis[i] = 2;
    else if ((y1 + m) % 2)
      vis[i] = 3;
    else
      vis[i] = 4;
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) printf("%d\n", vis[i]);
  return 0;
}
