#include <bits/stdc++.h>
using namespace std;
void fun(char c, string s, long long l, long long n) {
  if (l == n) {
    cout << s << endl;
    return;
  }
  for (char i = max((char)(c - 1), 'a'); i <= c + 1; i++) {
    fun(i, s + i, l + 1, n);
  }
}
inline void solve() {
  long long n;
  cin >> n;
  fun('a' - 1, "", 0, n);
  return;
}
signed main() {
  long long n = 1;
  while (n--) solve();
  return 0;
}
