#include <bits/stdc++.h>
using namespace std;
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << "=" << h << "\n";
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << "=" << h << ",";
  _dbg(sdbg + 1, a...);
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[";
  for (auto vv : V) os << vv << ",";
  return os << "]";
}
template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
char word[15];
int n;
void backtrack(int n, int w, char c) {
  if (w == n) {
    printf("%s\n", word);
    return;
  }
  word[w] = c;
  backtrack(n, w + 1, c);
  if (w > 0) {
    word[w] = c + 1;
    backtrack(n, w + 1, c + 1);
  }
}
int main() {
  scanf("%d", &n);
  backtrack(n, 0, 'a');
  return 0;
}
