#include<bits/stdc++.h>
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using namespace std;

int main(){
    int N;
    cin >> N;
    string B[12] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k"};
    vector<string> ans;
    rep(i, N){
        if (i == 0) {
            ans.push_back("a");
        } else {
            int s = ans.size();
            rep(k, s) {
                string tmp = ans[k];
                ans[k] += B[0];
                int res = ans[k][i-1] - 'a';
                REP(j,1, res+2) {
                    ans.push_back(tmp + B[j]);
                }
            }
        }

    }

    for(auto s: ans) {
        cout << s << endl;
    }

}