// Arup Guha
// 4/13/2026
// Program to Make Test Data for COP 3330 P8
// Note: I didn't use exactly this program, but I did something very similar to
//       to make the posted grading data.

import java.util.*;
import java.io.*;

public class MakeRandomRestStopCase {

	public static Random r;
	
	public static void main(String[] args) throws Exception {

		// Create my random object.
		r = new Random();
		
		// Set up the file that this program writes to (that will be an input file for the
		// rest stop program.)
		PrintWriter mine = new PrintWriter(new FileWriter("reststop10.in"));
		
		// Make the case.
		makeCase(100000, 1000000000,  mine);
		
		// Close the file.
		mine.close();
	}
	
	// Creates one input case for reststop with n queries, length of road roadLen
	// Writing it to the file that out is referencing.
	public static void makeCase(int n, int roadLen, PrintWriter out) {
	
		// First line of the file.
		out.println(n+" "+roadLen);
		
		// Helps us make data.
		TreeSet<Integer> markers = new TreeSet<Integer>();
		markers.add(0);
		markers.add(roadLen);
		
		// How many lines to output.
		for (int i=0; i<n; i++) {
		
			// I decided to do this 50/50...
			int op = 1 +r.nextInt(2);
		
			// Add a rest stop.
			if (op == 1) {
				
				// Generate a new rest stop that wasn't previously in the list.
				int newM = 0;
				while (markers.contains(newM))
					newM = r.nextInt(roadLen+1);
				
				// Output this line to our input file.
				out.println(op+" "+newM);
			}
			
			// Query.
			else {
				
				// Just randomly pick the mile marker and output the query to the input file.
				int marker = r.nextInt(roadLen+1);
				out.println(op+" "+marker);
			}
		}
		
	}

}