        #include <bits/stdc++.h>
        using namespace std;
        #define int long long
const int MAX = 510000;
const int MOD = 1000000007;

  
        signed main() {
     int n;
     cin>>n;
     
     int t=n,k=1,d[n]={};
     string s(n,'a'),s2;
     cout<<s<<endl;
        while(t){
                if(t==n){t--;}
                else{
                        if(d[t-1]==(s[t]-'a')){
                                d[t]=d[t-1]+1;
                                for(int j=t;j<n;j++){d[j]=d[t];}
                                s[t]++;t=n-1;cout<<s<<endl;
                                continue;}
                        
                        if(d[t-1]<(s[t]-'a')){d[t]=d[t-1];s[t]='a';t--;continue;}
                        s[t]++;
                        cout<<s<<endl;
                        t=n-1;
                }
        }
   
     
     
    

      
        


      }


        
