#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();
}
long long n;
vector<string> res;
void populate(long long index, string s) {
  if (index == n + 1) {
    res.push_back(s);
    return;
  }
  for (long long i = 0; i <= (s[index - 2] - 'a' + 1); i++) {
    s.push_back('a' + i);
    populate(index + 1, s);
    s.pop_back();
  }
}
int32_t main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  ;
  time_t start = now();
  cin >> n;
  populate(2, "a");
  sort(res.begin(), res.end());
  for (auto r : res) {
    cout << r << "\n";
  }
  cerr << "TIME => " << now() - start << "\n";
  return 0;
}
