#include "testlib.h"

const int minN = 2;
const int maxN = 100000;
const int minX = 1;
const int maxX = 1000000000;

int main() {
  registerValidation();
  int n = inf.readInt(minN, maxN);
  inf.readEoln();
  for (int i = 0; i < n; ++i) {
    inf.readInt(minX, maxX);
    inf.readSpace();
    inf.readInt(minX, maxX);
    inf.readEoln();
  }
  int k = inf.readInt(minN, maxN);
  inf.readEoln();
  for (int i = 0; i < k; ++i) {
    int l = inf.readInt(1, n);
    inf.readSpace();
    int r = inf.readInt(1, n);
    inf.readEoln();
    ensure(l < r);
  }
  inf.readEof();
  return 0;
}
