#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 5;
const int MOD = 998244353;
int a[MAXN];
int main() {
  int n;
  while (cin >> n) {
    for (int i = 1; i <= n; i++) a[i] = 0, printf("a");
    puts("");
    while (!a[1]) {
      a[n]++;
      int pos = n;
      while (pos > 0 && a[pos] > a[pos - 1] + 1) {
        a[pos] = 0;
        a[pos - 1]++;
        pos--;
      }
      if (a[1] != 0) break;
      for (int i = 1; i <= n; i++) printf("%c", a[i] + 'a');
      puts("");
    }
  }
}
