#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  set<string> ans;
  for (int mask = 0; mask < (1 << n); mask++) {
    string res = string(n, '?');
    int c = 0;
    for (int i = 0; i < n; i++) {
      if (mask & (1 << i)) {
        res[i] = 'a';
        if (c == 0) c++;
      } else
        res[i] = (c + 'a'), c++;
    }
    ans.insert(res);
  }
  for (auto& s : ans) {
    cout << s << '\n';
  }
  return 0;
}
