#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll=long long;
using vi = vector<int>;
using Graph = vector<vi>;
using P = pair<int,int>;
const int MOD=(int)1e9+7;
const int INF=(int)1e9;
const ll LINF=(ll)1e18;

int main(){
    int n;
    cin >> n;
    string ret = string(n,'a');
    set<string> se;
    vector<bool> che(2000);
    for(int i=0;i<(1<<n);i++){
        bitset<10> bit(i);
        //bitset<10> c = bit;
        //rep(k,n) c.flip(k);
        //cout << bit << endl;
        //cout << c << endl;
        //if(che[i] || che[c.to_ulong()]) continue;
        //che[i] = 1;
        //che[c.to_ulong()] = 1;
        string tmp = ret;
        rep(j,n){
            if(bit.test(j)){
                tmp[j]++;
            }
        }
        se.insert(tmp);
    }
    for(auto t : se){
        if(t[0]=='b') continue;
        cout << t << endl;
    }
}