#include <bits/stdc++.h>
template <class T>
inline T chmax(T& a, const T b) {
  return a = (a < b) ? b : a;
}
template <class T>
inline T chmin(T& a, const T b) {
  return a = (a > b) ? b : a;
}
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const ll MOD = 1000000007;
const ll INF = 1e18;
const double PI = acos(-1);
using namespace std;
struct INIT {
  INIT() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
  }
} INIT;
void dfs(ll depth, string s, char last) {
  if (depth == 0) {
    cout << s << "\n";
    return;
  }
  if (s == "")
    dfs(depth - 1, "a", 'a');
  else {
    for (char c = 'a'; c <= last + 1; c++) {
      dfs(depth - 1, s + c, c);
    }
  }
}
signed main() {
  ll N;
  cin >> N;
  dfs(N, "", 'a');
  return 0;
}
