import ru.ifmo.validate.*;

public class Validate implements Validator {

	static final int MAX_N = 100000;
	static final int MAX_M = 10;
	static final int MAX = 1_000_000_000;

	public void validate(ValidatingScanner in) {
		int n = in.nextInt(1, MAX_N);
		int m = in.nextInt(1, MAX_M);
		in.eoln();

		int prev_t = 1;
		for (int i = 0; i < n; i++) {
			prev_t = in.nextInt(prev_t, MAX);
			int a = in.nextInt(1, MAX);
			int b = in.nextInt(1, MAX);
			in.eoln();
		}
	}

}
