#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 6;
const long long M = 1e9 + 7;
long long n;
long long a;
void alpha(char ch, long long i, string str, map<string, long long> &m) {
  if (i == a) {
    if (m.find(str) == m.end()) {
      cout << str << "\n";
    }
    m[str]++;
    return;
  }
  char nch = ch + 1;
  char ch1 = 'a';
  while (ch1 <= ch) {
    alpha(ch1, i + 1, str + ch1, m);
    ch1++;
  }
  alpha(ch, i + 1, str + ch, m);
  alpha(nch, i + 1, str + nch, m);
}
void solve() {
  cin >> a;
  string s = "a";
  char ch = 'a';
  map<string, long long> m;
  alpha(ch, 1, s, m);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) solve();
}
