#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;

void dfs(vector<char> vec,char c) {
    vec.push_back(c);
    if (vec.size() == N) {
        for (ll i = 0;i<N;i++) {
            if (i == N-1) cout << vec.at(i) << endl;
            else cout << vec.at(i);
        }
    }
    for (ll i = -1;i<=1;i++) {
        if (c == 'a' && i == -1) continue;
        c += i;
        dfs(vec,c);
}

int main() {
    char c = 'a';
    vector<char> vec;
    ll N;
    cin >> N;
    dfs(vec,c);
}