#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
    int n;
    cin>>n;
    //string s[n];
    /*for (int i = 0; i < n; ++i) {
        cin>>s[i];
    }
    int count=0;
    for (int j = 0; j < n; ++j) {
        int ma=0;
        for (int i = 0; i <s[j].length(); ++i) {
            if(s[j][i]=='a')ma=max(ma,1);
            if(s[j][i]=='b')ma=max(ma,2);
            if(s[j][i]=='c')ma=max(ma,3);
            if(s[j][i]=='d')ma=max(ma,4);
            if(s[j][i]=='e')ma=max(ma,5);
            if(s[j][i]=='f')ma=max(ma,6);
            if(s[j][i]=='g')ma=max(ma,7);
            if(s[j][i]=='h')ma=max(ma,8);
            if(s[j][i]=='i')ma=max(ma,9);
            if(s[j][i]=='j')ma=max(ma,10);
        }
        for (int k = 1; k <= ma+1; ++k) {
            count++;
            cout<<"cout<<\""<<s[j];
            if(k==1)cout<<"a"<<"\"<<endl;"<<endl;
            if(k==2)cout<<"b"<<"\"<<endl;"<<endl;
            if(k==3)cout<<"c"<<"\"<<endl;"<<endl;
            if(k==4)cout<<"d"<<"\"<<endl;"<<endl;
            if(k==5)cout<<"e"<<"\"<<endl;"<<endl;
            if(k==6)cout<<"f"<<"\"<<endl;"<<endl;
            if(k==7)cout<<"g"<<"\"<<endl;"<<endl;
            if(k==8)cout<<"h"<<"\"<<endl;"<<endl;
            if(k==9)cout<<"i"<<"\"<<endl;"<<endl;
            if(k==10)cout<<"j"<<"\"<<endl;"<<endl;
        }
        /*for (int k = 1; k <= ma+1; ++k) {
            cout<<s[j];
            if(k==1)cout<<"a"<<endl;
            if(k==2)cout<<"b"<<endl;
            if(k==3)cout<<"c"<<endl;
            if(k==4)cout<<"d"<<endl;
            if(k==5)cout<<"e"<<endl;
            if(k==6)cout<<"f"<<endl;
            if(k==7)cout<<"g"<<endl;
            if(k==8)cout<<"h"<<endl;
            if(k==9)cout<<"i"<<endl;
            if(k==10)cout<<"j"<<endl;
        }
    for (int j = 0; j < n; ++j) {
        int ma=0;
        for (int i = 0; i <s[j].length(); ++i) {
            if(s[j][i]=='a')ma=max(ma,1);
            if(s[j][i]=='b')ma=max(ma,2);
            if(s[j][i]=='c')ma=max(ma,3);
            if(s[j][i]=='d')ma=max(ma,4);
            if(s[j][i]=='e')ma=max(ma,5);
            if(s[j][i]=='f')ma=max(ma,6);
            if(s[j][i]=='g')ma=max(ma,7);
            if(s[j][i]=='h')ma=max(ma,8);
            if(s[j][i]=='i')ma=max(ma,9);
            if(s[j][i]=='j')ma=max(ma,10);
        }
        /*for (int k = 1; k <= ma+1; ++k) {
            count++;
            cout<<"cout<<\""<<s[j];
            if(k==1)cout<<"a"<<"\"<<endl;"<<endl;
            if(k==2)cout<<"b"<<"\"<<endl;"<<endl;
            if(k==3)cout<<"c"<<"\"<<endl;"<<endl;
            if(k==4)cout<<"d"<<"\"<<endl;"<<endl;
            if(k==5)cout<<"e"<<"\"<<endl;"<<endl;
            if(k==6)cout<<"f"<<"\"<<endl;"<<endl;
            if(k==7)cout<<"g"<<"\"<<endl;"<<endl;
            if(k==8)cout<<"h"<<"\"<<endl;"<<endl;
            if(k==9)cout<<"i"<<"\"<<endl;"<<endl;
            if(k==10)cout<<"j"<<"\"<<endl;"<<endl;
        }
        for (int k = 1; k <= ma+1; ++k) {
            cout<<s[j];
            if(k==1)cout<<"a"<<endl;
            if(k==2)cout<<"b"<<endl;
            if(k==3)cout<<"c"<<endl;
            if(k==4)cout<<"d"<<endl;
            if(k==5)cout<<"e"<<endl;
            if(k==6)cout<<"f"<<endl;
            if(k==7)cout<<"g"<<endl;
            if(k==8)cout<<"h"<<endl;
            if(k==9)cout<<"i"<<endl;
            if(k==10)cout<<"j"<<endl;
        }
    }
    cout<<count<<endl;*/

    vector<string> s[11];
    s[1].push_back("a");
    for (int l = 1; l <= 9; ++l) {
        for (int i = 0; i < s[l].size(); ++i) {
            int ma=0;
            for (int j = 0; j <s[l][i].length(); ++j) {
                if(s[l][i][j]=='a')ma=max(ma,1);
                if(s[l][i][j]=='b')ma=max(ma,2);
                if(s[l][i][j]=='c')ma=max(ma,3);
                if(s[l][i][j]=='d')ma=max(ma,4);
                if(s[l][i][j]=='e')ma=max(ma,5);
                if(s[l][i][j]=='f')ma=max(ma,6);
                if(s[l][i][j]=='g')ma=max(ma,7);
                if(s[l][i][j]=='h')ma=max(ma,8);
                if(s[l][i][j]=='i')ma=max(ma,9);
                if(s[l][i][j]=='j')ma=max(ma,10);
            }
            for (int k = 1; k <= ma+1; ++k) {
                string t=s[l][i];
                if(k==1)t+="a";
                if(k==2)t+="b";
                if(k==3)t+="c";
                if(k==4)t+="d";
                if(k==5)t+="e";
                if(k==6)t+="f";
                if(k==7)t+="g";
                if(k==8)t+="h";
                if(k==9)t+="i";
                if(k==10)t+="j";
                s[l+1].push_back(t);
            }
        }
    }
    for (int m = 0; m < s[n].size(); ++m) {
        cout<<s[n][m]<<endl;
    }

}
//cout<<"cout<<\""<<s[j]<<"\"<<endl;"<<endl;

Measured memory_bytes: 11380