#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
const int INF = 0x3F3F3F3F;
const int64_t LINF = 4611686018427387903;
const int MOD = 1e9 + 7;
const int MAXN = 2e5 + 9;
void solve(int now, int n, string s) {
  if (now == n) {
    cout << s << '\n';
    return;
  }
  solve(now + 1, n, s + s.back());
  solve(now + 1, n, s + char(int(s.back()) + 1));
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  int n;
  cin >> n;
  solve(1, n, "a");
  return 0;
}
