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

#include <vector>
#include <string>
#include <iterator>
#include <algorithm>

using std::string;
using std::vector;
using std::back_inserter;
using std::random_shuffle;

template<class Out>
void random(Out iter) 
{
    string a;
    for (int i = 0; i < 20; i++) 
    {
        a += (char) ('a' + rand() % 26);
    }    
    *iter++ = a;
}

int main(int argc, char **argv) 
{
    srand(atoi(argv[1]));
    vector<string> words;
    for (int i = 0; i < 500; i++) 
    {
        random(back_inserter(words));
    }
    printf("%d %d\n", words.size(), words.size());
    for (vector<string>::iterator it = words.begin(); it != words.end(); ++it) 
    {
        printf("%s\n", it->c_str());
    }
    random_shuffle(words.begin(), words.end());
    for (vector<string>::iterator it = words.begin(); it != words.end(); ++it) 
    {
        printf("%s\n", it->c_str());
    }
    return 0;
}
