#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

const int N = 3e5 + 5000;
int n;

void dfs(int now, int lst)
{
    if (now == n) {
        cout << s << endl;
        return;
    }
    for (int i = 1; i <= lst; i++)
        s[now] = 'a' + i - 1, dfs(now + 1, lst);
    if (lst < n)
        s[now] = 'a' + lst, dfs(now + 1, lst + 1);
}

char s[] = "aaaaaaaaaa";

int main()
{
#ifdef ONLINE_JUDGE
#else
    // freopen("r.txt", "r", stdin);
    // freopen("w.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false);

    s[n] = '#';
    dfs(1, 1);
    return 0;
}
