#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

int a[50];

void swap(int & a,int &b) {
	int c = a;
	a = b;
	b = c;
}

int main(int argc, char * arg[]) {

	assert(argc>3);
	int k,mc,mg;
	sscanf(arg[1],"%d",&k);
	sscanf(arg[2],"%d",&mc);
	sscanf(arg[3],"%d",&mg);

    printf("%d\n%d\n",k,mc+mg);
    memset(a, 0 ,sizeof(a));

    k--;

    time_t tt;
    time(&tt);
    srand(tt);
    int j,r;
    int i;
    for (i=0;i<mc;i++) {
    	do {
    		j = rand()%k+1;
    	} while (a[j]>1);
    	a[j]++;
    	printf("2 0 %d\n",j);
    }

    int x,y,z;

    memset(a, 0 ,sizeof(a));
    for (i=0;i<mg;i++) {
    	if (rand()%2) {
    		printf("2 ");
    		do {
    			x = rand()%(k-1)+1;
    		} while (a[x]);
    		a[x] = 1;			
			do {
    			y = rand()%(k-1)+1;
    		} while (a[y]);
    		a[y] = 1;
    		if (x>y) swap(x,y);
    		printf("%d ",x);
			printf("%d\n",y);
    	} else {
    		printf("3 ");
    		do {
    			x = rand()%(k-1)+1;
    		} while (a[x]);
    		a[x] = 1;
			do {
    			y = rand()%(k-1)+1;
    		} while (a[y]);
    		a[y] = 1;
    		do {
    			z = rand()%(k-1)+1;
    		} while (a[z]);
    		a[z] = 1;

    		if (x>y) swap(x,y);
			if (x>z) swap(x,z);
			if (y>z) swap(y,z);

    		printf("%d ",x);
    		printf("%d ",y);
			printf("%d\n",z);
    	}
    } 

    
}