#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<string> ans(1, "a");
  for (int i = 0; i < n - 1; ++i) {
    int s = ans.size();
    for (int ci = 0; ci < i; ++ci) {
      for (int si = 0; si < s; ++si) {
        ans.emplace_back(ans[si]);
        ans[ans.size() - 1] += ('a' + ci + 1);
      }
    }
    for (int x = 0; x < s; ++x) ans[x] += 'a';
    string last = ans[ans.size() - 1];
    last[last.size() - 1] = 'a' + i + 1;
    ans.emplace_back(last);
  }
  for (int i = 0; i < ans.size(); ++i) cout << ans[i] << endl;
}
