#include <bits/stdc++.h>
using namespace std;
char str[11];
void hoge(int pos, char last, long long N) {
  if (pos == N - 1) {
    str[N] = '\0';
    printf("%s\n", str);
    return;
  }
  for (char c = 'a'; c <= last + 1; c++) {
    str[pos + 1] = c;
    hoge(pos + 1, last + 1, N);
  }
}
void solve(long long N) {
  str[0] = 'a';
  hoge(0, 'a', N);
}
int main() {
  long long N;
  scanf("%lld", &N);
  solve(N);
  return 0;
}
