#include "problem_lib.h"
 
int main(int argc, char* argv[])
{
	registerGen(argc, argv, 1);

    int t = opt<int>("t");
    
	int L = opt<int>("L");
	int R = opt<int>("R");
    int max_dist = opt<int>("max_dist");
    
    assert(L <= R && "L must be less or equal than R");
    assert(max_dist >= 0 && "max_dist must be non-negative");
    
    println(t);
    for (int test = 1; test <= t; ++test) 
    {
        setTestCase(test);
        
        int left = rnd.next(L, R);
	    int add = rnd.next(0, std::min(R - left, max_dist));
        int right = left + add;
        println(left, right);
    }
	return 0;
}
