#include "testlib.h"
#include <bits/stdc++.h>

using namespace std;


int main(int argc, char* argv[]) {
    registerValidation(argc, argv);
    int n = inf.readInt(1, 1e5, "n");
    inf.readEoln();
    for (int i = 0; i < n; i++) {
        int l = inf.readInt(1, 1e4, "li");
        inf.readSpace();
        int r = inf.readInt(1, 1e4, "ri");
        inf.readEoln();
        ensuref(l <= r, "Interval end time must be at least interval start time");
    }
    inf.readEof();
    return 0;
}