#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
struct __INIT {
  __INIT() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
  }
} __init;
int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
char alf[26];
int N;
void solve(int rem, int now, string out, bool fin, int kind) {
  if (rem == 0) {
    cout << out << "\n";
    ;
    return;
  }
  out += alf[now];
  if (rem == 1) {
    solve(0, 0, out, 0, 0);
    return;
  }
  if (fin == false) {
    for (int(i) = 0; (i) < (now + 2); (i)++) {
      if (i < now)
        solve(rem - 1, i, out, 1, now);
      else
        solve(rem - 1, i, out, 0, 0);
    }
  } else
    for (int(i) = 0; (i) < (kind); (i)++) solve(rem - 1, i, out, 1, kind);
}
int main(void) {
  cin >> N;
  for (int(i) = 0; (i) < (26); (i)++) alf[i] = 'a' + i;
  solve(N, 0, "", false, 0);
}
