#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];
void solve(int rem, int now, string out) {
  if (rem == 0) {
    cout << out << "\n";
    ;
    return;
  }
  out += alf[now];
  if (rem == 1) {
    solve(0, 0, out);
    return;
  }
  for (int(i) = 0; (i) < (now + 2); (i)++) solve(rem - 1, i, out);
}
int main(void) {
  int N;
  cin >> N;
  for (int(i) = 0; (i) < (26); (i)++) alf[i] = 'a' + i;
  solve(N, 0, "");
}
