#include<stdio.h>
#include<stdlib.h>
char dic[2024*1024];
int main(int argv, char **argc){
    int I=0;
    char s[16];
    srand(argv >= 3 ? atoi(argc[3]) : 0);
    int maxtest = (argv >= 2 ? atoi(argc[2]) : 0);
    for(I=(argv >= 1 ? atoi(argc[1]) : 0);I<=maxtest;I++){
        sprintf(s, "%02d", I);
        freopen(s,"w",stdout);
        int n = 1000000 - rand();
        int k = rand()*30, m=1;
        int i=0, i0 = 0;
        for(i=0;i<n;i++)
            putchar(rand()%('z'-'a')+'a');
        for(i=0;i<k;i++){
            dic[i] = rand()%('z'-'a')+'a';
            if((rand()&0xf) == 0 && i-i0>3){
                dic[i] = '\n', m++;
                i0 = i;
            }
        }
        printf("\n%d\n", m);
        puts(dic);
    }
}
