#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
char a[20];
int n;
void dfs(int i) {
  if (i == 0) return;
  bool flag = 0;
  while (a[i] <= a[i - 1]) {
    a[i]++;
    flag = 1;
    printf("%s\n", a);
  }
  while (a[i] == a[i - 1] + 1) i--;
  if (i == 0) return;
  a[i]++;
  for (int j = i + 1; j <= n - 1; j++) a[j] = 'a';
  printf("%s\n", a);
  dfs(n - 1);
}
void solve() {
  scanf("%d", &n);
  for (int i = 0; i <= n - 1; i++) a[i] = 'a';
  printf("%s\n", a);
  dfs(n - 1);
}
int main() {
  solve();
  return 0;
}
