#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
long long n, cnt[10];
bool f(long long x) {
  for (long long i = (x); i < (n); i++) {
    if (cnt[i] != x) {
      return false;
    }
  }
  return true;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  memset(cnt, 0, sizeof(cnt));
  for (long long j = (0); j < (n); j++) {
    cout << char(cnt[j] + 'a');
  }
  cout << endl;
  for (long long i = (1); i < (n); i++) {
    while (!f(i)) {
      cnt[n - 1]++;
      for (long long j = (n - 1); j >= (i); j--) {
        if (cnt[j] > i) {
          cnt[j] = 0;
          cnt[j - 1]++;
        }
      }
      for (long long j = (0); j < (n); j++) {
        cout << char(cnt[j] + 'a');
      }
      cout << endl;
    }
  }
  return 0;
}
