#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
template <typename T>
inline void Max(T &a, T &b) {
  if (a < b) a = b;
}
template <typename T>
inline void Min(T &a, T &b) {
  if (a > b) a = b;
}
const double pi = (double)acos(-1.0);
const double eps = (double)1e-8;
const int INF = (int)0x3f3f3f3f;
const int MOD = (int)998244353;
const int MAXN = (int)3e3 + 10;
const int MAXM = (int)3e6 + 10;
int N;
char ans[111];
void DFS(int cur) {
  if (cur == N) {
    ans[N] = '\0';
    printf("%s\n", ans);
    return;
  }
  for (int i = 0; i <= cur; i++) {
    ans[cur] = 'a' + i;
    DFS(cur + 1);
  }
}
void work() {
  scanf("%d", &N);
  DFS(0);
}
int main() {
  work();
  return 0;
}
