#include <bits/stdc++.h>
using namespace std;
long long fastpow(long long a, long long b, long long m) {
  long long res = 1;
  a %= m;
  while (b > 0) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
long long now() {
  return chrono::duration_cast<chrono::milliseconds>(
             chrono::system_clock::now().time_since_epoch())
      .count();
}
int32_t main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  ;
  time_t start = now();
  long long n;
  cin >> n;
  vector<string> res = {"a"};
  for (long long i = 2; i <= n; i++) {
    vector<string> res2;
    for (long long j = 0; j < i; j++) {
      for (auto r : res) {
        res2.push_back(r);
        res2[res2.size() - 1].push_back(j + 'a');
      }
    }
    res = res2;
  }
  sort(res.begin(), res.end());
  for (auto r : res) {
    cout << r << "\n";
  }
  cerr << "TIME => " << now() - start << "\n";
  return 0;
}
