#include<iostream>
#include<cstdio>
#include<ctime>
#include<cstdlib>
#include<algorithm>
#include<vector>
using namespace std;

int main(){
	freopen("hotels.in","w",stdout);
    srand(time(NULL));
    int n = rand()%10 + 1;
    printf("%d\n", n);
    for (int i = 0; i < n; ++i)
    	printf("%d %d\n", rand() % 10 + 1, rand() % 10 + 1);
    int t = rand() % 20;
    printf("%d\n", t);
    for (int i = 0; i < t; ++i) {
    	int r = rand() % n + 1;
    	int l = rand() % r + 1;
    	int k = rand() % 100 + 1;
    	printf("%d %d %d\n",l , r, k);
    }        
   	return 0;
}