#include <bits/stdc++.h>
using namespace std;
const long long INF = 10000000000000000;
const long long mod = 1000000007;
string s[123456];
long long g = 1;
void G(long long n) {
  for (long long a = 1; a < n; a++) {
    long long kari = g;
    for (long long h = 0; h < kari; h++) {
      for (long long i = 0; i < (long long)(s[h][s[h].size() - 1]) - 96; i++) {
        s[g] = s[h] + (char)(98 + i);
        g++;
      }
      s[h] += "a";
    }
  }
}
long long iti[12345678], cnt[12345678], cost[4321][4321];
signed main() {
  long long n, m, a = 140, b = 170, cnt = 30, ans = 0;
  cin >> n;
  s[0] = "a";
  G(n);
  sort(s, s + g);
  for (long long h = 0; h < g; h++) {
    cout << s[h] << endl;
  }
  cin >> n;
  return 0;
}
