#include <bits/stdc++.h>
void dfs(int n, char xz, int now, char a[]) {
  if (now == n)
    printf("%s\n", a);
  else {
    for (char i = 'a'; i <= xz; i++) {
      a[now] = i;
      if (i == xz)
        dfs(n, xz + 1, now + 1, a);
      else
        dfs(n, xz, now + 1, a);
    }
  }
}
int main() {
  int n, now = 0;
  char a[11];
  scanf("%d", &n);
  dfs(n, 'a', now, a);
  return 0;
}
