#include "testlib.h"

using namespace std;

int const MAX_T = 1'000;
int const MAX_N = 100'000;

int main(int argc, char **argv) {
  registerValidation(argc, argv);
  int tests = inf.readInt(1, MAX_T, "t");
  inf.readEoln();
  int sum = 0;
  for (int i = 1; i <= tests; i++) {
    setTestCase(i);
    int n = inf.readInt(1, MAX_N - sum, "n");
    sum += n;
    inf.readEoln();
    inf.readInts(n, 1, 3, "start");
    inf.readEoln();
    inf.readInts(n, 1, 3, "finish");
    inf.readEoln();
  }
  inf.readEof();
  return 0;
}