#include <iostream>
#include <algorithm>
#include <set>
#include <string>
#include <cstdio>
#include <string>
#include <stdio.h>

using namespace std;

int main(int argc, char ** argv)
{
    srand(atoi(argv[1]));
    int mode = atoi(argv[2]);
    set <string> used;
    string s, q;
    if (mode)
    {
        cout << 50000 << endl;
        q = "";
        for (int l = 0; l < 15; l++)
            q += 'a' + rand() % 26;

        for (int i = 0; i < 50000; i++)
        {
            do
            {
                s = "";
                for (int l = 0; l < 15; l++)
                    s += 'a' + rand() % 26;
            }
            while (used.find(s) != used.end());
            used.insert(s);
        }
        set <string>::iterator it = used.begin();
        for ( ; it != used.end(); ++it)
        {
            cout << *it << " - " << q << endl;
        }

    } else
    {
        cout << 1 << endl;
        s = "";
        for (int l = 0; l < 15; l++)
            s += 'a' + rand() % 26;
        cout << s << " - ";
        for (int i = 0; i < 99999; i++)
        {
            do
            {
                s = "";
                for (int l = 0; l < 15; l++)
                    s += 'a' + rand() % 26;
            }
            while (used.find(s) != used.end());
            used.insert(s);
        }
        set <string>::iterator it = used.begin();
        for ( ; it != used.end(); ++it)
        {
            set <string>::iterator p;
            p = it;
            if (++p != used.end())
                cout << *it << ", ";
            else
                cout << *it << endl;
        }
    }
    return 0;
}
