#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int N;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cin >> N;
  string s;
  for (int i = 0; i < N; i++) s += 'a';
  while (true) {
    cout << s << endl;
    int d = N - 1;
    s[d]++;
    while (d > 0 and s[d] - 'a' > d) {
      s[d] = 'a';
      d--;
      s[d]++;
    }
    if (d == 0) break;
  }
  return 0;
}
