#include <bits/stdc++.h>  
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define forn(i,a,b)        for( i = a ; i < b  ; i++ )
#define debug(x)           cout << #x << " " << x << " -- "
#define I__O               ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define ll                 long long  
#define p(x)               cout << x << "\n" ; 
#define MOD                100000007
#define pi                 pair<int,int>
#define vi                 vector <int>
#define pb                 push_back
#define vp                 vector <pair<ll,ll>>
#define endl               cout << "\n"
#define mi                 map <int,int> 
#define f1                 first 
#define s1                 second    
#define in                 insert
#define all(x)             x.begin(),x.end() 
/*
    time : 6:26:43 PM
    date : 3/12/2020
*/    
using namespace std ; 
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set ; 
const int N = 2e5;  
int n ; 
int c ; 
void solve(int inx,string s ){
  if(inx == n){
    c++ ; 
    cout << s << '\n' ;
    return ;
  }
  int j ; 
  // debug(inx) ; 
  forn(j,0,1+inx){ 
    s.push_back('a'+j);
      solve(inx+1,s) ;
    s.pop_back();
  }  
  return ;
} 
int tests(){ 
  cin >> n ;  
  string S ;
  S.push_back('a');
    solve(1,S) ;  
  return 0 ; 
}
int main(){
    I__O ;  
    int cases = 1 ; 
    // cin >> cases ; 
    while(cases--)
      tests(); 
    return 0 ; 
}
