#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll INF = 1LL<<60;
const ll MOD = 1e9 + 7;

ll N;
map<vector<char>,int> mp;
vector<vector<char>> veclist;
void dfs(vector<char> vec,char c,long long N) {
    vec.push_back(c);
    if (vec.size() == N && mp[vec] == 0) {
        mp[vec]++;
        veclist.push_back(vec);
        //for (ll i = 0;i<N;i++) {
        //    if (i == N-1) cout << vec.at(i) << endl;
        //    else cout << vec.at(i);
        //}
        return;
    }
    if (vec.size() == N && mp[vec] != 0) return;

    for (ll i = -1;i<=1;i++) {
        char next_c;
        next_c = c;
        if (c == 'a' && i == -1) continue;
        if (i == -1) next_c--;
        if (i == 1) next_c++; 
        //cout << i << " " << c << next_c << endl;
        dfs(vec,next_c,N);
    }
}

int main() {
    char c = 'a';
    vector<char> vec;
    ll N;
    cin >> N;
    dfs(vec,c,N);
    sort(veclist.begin(),veclist.end());
    for (ll i = 0;i<veclist.size();i++) {
        for (ll j = 0;j<N;j++) {
            if (j == N-1) cout << veclist.at(i).at(j) << endl;
            else cout << veclist.at(i).at(j);
        }
    }
}