#include <bits/stdc++.h>
using namespace std;
long long read() {
  char ch = getchar();
  long long x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int main() {
  int n;
  cin >> n;
  char a[n], str[n];
  a[n] = str[n] = '\0';
  for (int i = 0; i < n; i++) str[i] = 'a' + i;
  fill(a, a + n, 'a');
  int len = n - 1;
  puts(a);
  int x = 0;
  while (strcmp(a, str) != 0) {
    int l = len;
    while (l >= x + 1) {
      a[l]++;
      l--;
      puts(a);
      if (strcmp(a, str) == 0) break;
    }
    x++;
  }
  return 0;
}
