#include <bits/stdc++.h>
using namespace std;
class Solver {
 private:
  set<string> s;

 public:
  void test() {
    { this->solve(); }
  }
  void solve() {
    long long n;
    cin >> n;
    helper(0, n, "");
    for (auto i : s) cout << i << endl;
  }
  void helper(long long cur, long long n, string k) {
    if (n == 0) {
      s.insert(k);
      return;
    }
    for (long long i = 0; i <= cur; ++i) {
      helper(cur + 1, n - 1, k + (char)(i + 'a'));
    }
  }
};
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  Solver S;
  S.test();
  return 0;
}
