#include <bits/stdc++.h>
char s[12];
int a[27];
int n;
void fill(int u, int mx) {
  if (u == n + 1) {
    s[n + 1] = 0;
    printf("%s\n", s + 1);
    return;
  }
  if (s[u])
    fill(u + 1, s[u] - 'a' + 1);
  else {
    for (int i = 1; i <= mx; ++i) {
      s[u] = i + 'a' - 1;
      fill(u + 1, mx);
      s[u] = 0;
    }
  }
}
void sel(int u, int cur) {
  if (u == n + 1) {
    memset(s, 0, sizeof(s));
    for (int i = 1; i < cur; ++i) s[a[i]] = i + 'a' - 1;
    fill(2, 1);
    return;
  }
  sel(u + 1, cur);
  a[cur++] = u;
  sel(u + 1, cur);
}
int main() {
  scanf("%d", &n);
  a[1] = 1;
  sel(2, 2);
  return 0;
}
