#include "testlib.h"

constexpr int MAX_N = 1000;
constexpr int MAX_TOT_N = 10'000;
constexpr int MAX_C = 1'000'000;

int main(int argc, char **argv) {
  registerValidation(argc, argv);
  int t = inf.readInt(1, MAX_TOT_N / 3, "t");
  inf.readEoln();
  int totn = 0;
  for (int i = 0; i < t; i++) {
    setTestCase(i + 1);
    int n = inf.readInt(3, MAX_N, "n");
    inf.readEoln();
    totn += n;
    ensure(totn <= MAX_TOT_N);
    for (int i = 0; i < n; i++) {
      int x1 = inf.readInt(-MAX_C, MAX_C, "x1");
      inf.readSpace();
      int y1 = inf.readInt(-MAX_C, MAX_C, "y1");
      inf.readSpace();
      int x2 = inf.readInt(-MAX_C, MAX_C, "x2");
      inf.readSpace();
      int y2 = inf.readInt(-MAX_C, MAX_C, "y2");
      inf.readEoln();
      ensure(x1 != x2 || y1 != y2);
    }
  }
  inf.readEof();
}
