#include <stdio.h>
#include <stdlib.h>

#define N 350

#define MAX1 (10000000-1)
#define MAXB1 50
#define MAX2 (100-1)
#define MAXB2 10

int main()
{
  int i, j;

  printf("%d\n", N);  
  for (i=0; i<N; i++)
  {
    int k, m, max;
    
    if ((i+1) % 60 == 0) 
    { max=MAX1; m=MAXB1; } else 
    {
      max=MAX2;    
      m=rand() % MAXB2 + 1;
    }
    k=(rand() % m) / (rand() % 2 + 1) + 1;
    
    printf("%d %d\n", m, k);
    
    printf("%d", rand() % max + 1);
    for (j=1; j<m; j++)
      printf(" %d", rand() % max + 1);
    printf("\n");
  }


  return 0;
}
