#include "validator.h"

using namespace std;

void run() {
    int MAXN = toml<int>("MAXN");
    int MAXR = toml<int>("MAXR");
    string MODE = toml<string>("MODE");
    int n = Int(1, MAXN);
    Endl();

    set<pair<int,int>> pairs;
    vector<pair<int,int>> pairs2;
    for(int i = 0; i < n; i++){
      int L = Int(0, MAXR);
      Space();
      int R = Int(0, MAXR);
      Endl();
      if (L >= R) die_line("L should be less than R");
      if (pairs.count({L,R})) die_line("duplicate pair " + to_string(L) + " " + to_string(R));
      pairs.insert({L,R});
      if (MODE == "line" && i > 0 && (L < pairs2.back().first || R < pairs2.back().second)) {
          die_line("No line");
      }
      if (MODE == "mono" && i > 0 && L <= pairs2.back().first) {
          die_line("In this subtask, left endpoints should be strictly increasing");
      }
      if (MODE == "tiny-intervals" && R - L > 2) {
          die_line("In this subtask, interval length should be <= 2");
      }
      pairs2.push_back({L,R});
    }
    Eof();
    return;
}
