#include <bits/stdc++.h>

#define rep(n, i) for (int i = 0; i < (n); ++i)

using ll = long long;
using namespace std;

string
caesar (const string & s)
{
    string t;
    transform(s.begin(), s.end(), back_inserter(t),
              [](auto c){ return c+1; });
    return t;
}

auto
query (int n)
{
    vector<string> f[11];

    f[0].push_back("");
    for (int i = 1; i <= n; ++i) {
      rep(i, j) {
        for (const auto e : f[j]) {
          f[i].push_back(string(i - j, 'a') + caesar(e));
        }
      }
    }

    return f[n];
}

int
main ()
{
    int n;
    cin >> n;

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