#include <bits/stdc++.h>
using namespace std;
int a[11], n;
inline void Print() {
  for (int i = 1; i <= n; ++i) cout << (char)(a[i] + 'a');
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (;;) {
    if (a[1] == 1) break;
    Print();
    ++a[n];
    int t = n;
    for (int i = n; i > 1; --i) {
      if (a[i] > i - 1) {
        ++a[i - 1];
        t = i - 1;
      }
    }
    if (t == 1) break;
    for (int i = t; i <= n; ++i) a[i] = a[t];
  }
}
