#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000007;
const int MOD = 1000000007;
int n;
void solve(vector<string>& res, int cur, string buf) {
  if (cur == n) {
    res.push_back(buf);
  } else {
    cur++;
    for (int i = 0; i < cur; ++i) {
      string next = buf;
      next += 'a' + i;
      solve(res, cur, next);
    }
  }
}
signed main() {
  cin >> n;
  vector<string> res;
  int cur = 0;
  string buf;
  solve(res, cur, buf);
  sort(res.begin(), res.end());
  int k = res.size();
  for (int i = 0; i < k; ++i) {
    cout << res[i] << endl;
  }
  cout << flush;
  return 0;
}
