#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using pll = pair<ll, ll>;
const ll mod = static_cast<ll>(1e9) + 7;
ll N;
string S;
void solve(ll n, ll p) {
  if (n == N) {
    cout << S << endl;
    return;
  }
  for (ll i = 0; i < ll(p + 1); ++i) {
    S[n] = 'a' + i;
    solve(n + 1, i + 1);
  }
}
int main() {
  cin >> N;
  for (ll i = 0; i < ll(N); ++i) {
    S += 'a';
  }
  solve(0, 0);
  return 0;
}
