#include <bits/stdc++.h>
using namespace std;
typedef struct Rect {
  int x1, y1, x2, y2;
} Rect;
class TaskD {
 private:
  inline bool overlap(const Rect& A, const Rect& B) {
    return (A.x1 <= B.x2 && A.x2 >= B.x1 && A.y1 < B.y2 && A.y2 > B.y1) ||
           (A.x1 < B.x2 && A.x2 > B.x1 && A.y1 <= B.y2 && A.y2 >= B.y1);
  }
  bool dfs(int u, const vector<vector<int>>& g, vector<int>& color) {
    int col = 1;
    for (int i = 0; i < (int)g[u].size(); ++i) {
      int v = g[u][i];
      if (color[v] == col) {
        ++col;
      }
    }
    if (col == 5) {
      return false;
    }
    color[u] = col;
    for (int i = 0; i < (int)g[u].size(); ++i) {
      int v = g[u][i];
      if (color[v] == 0) {
        if (!dfs(v, g, color)) {
          return false;
        }
      }
    }
    return true;
  }

 public:
  void solve(istream& in, ostream& out) {
    int n;
    in >> n;
    vector<Rect> rects(n);
    for (int i = 0; i < n; ++i) {
      in >> rects[i].x1 >> rects[i].y1 >> rects[i].x2 >> rects[i].y2;
    }
    out << "YES\n";
    for (int i = 0; i < n; ++i) {
      if ((rects[i].x1 % 2 + 2) % 2 == 0 && (rects[i].y1 % 2 + 2) % 2 == 0) {
        out << "1\n";
      } else if ((rects[i].x1 % 2 + 2) % 2 == 1 &&
                 (rects[i].y1 % 2 + 2) % 2 == 0) {
        out << "2\n";
      } else if ((rects[i].x1 % 2 + 2) % 2 == 1 &&
                 (rects[i].y1 % 2 + 2) % 2 == 1) {
        out << "3\n";
      } else if ((rects[i].x1 % 2 + 2) % 2 == 0 &&
                 (rects[i].y1 % 2 + 2) % 2 == 1) {
        out << "4\n";
      }
    }
  }
};
int main() {
  std::ios::sync_with_stdio(false);
  TaskD solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
