#include <bits/stdc++.h>
using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;
constexpr llong mod = 1e9 + 7;
constexpr llong inf = mod * mod;
llong N;
vector<string> ans;
void solve(int now, vector<int> &vec) {
  if (now == N) {
    string s = "";
    for (auto v : vec) {
      s += 'a' + v;
    }
    ans.push_back(s);
    return;
  }
  for (int i = 0; i <= vec[now - 1] + 1; i++) {
    vec[now] = i;
    solve(now + 1, vec);
  }
  return;
}
int main() {
  cin >> N;
  vector<int> vec(N, 0);
  solve(1, vec);
  for (auto a : ans) {
    cout << a << endl;
  }
  return 0;
}
