#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << " " << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
void inp_out() {}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  vector<string> v;
  v.push_back("a");
  for (long long int i = 2; i <= n; ++i) {
    vector<string> temp;
    for (long long int j = 0; j < v.size(); ++j) {
      for (long long int k = 1; k <= i; ++k) {
        string s = v[j];
        s += ('a' + k - 1);
        temp.push_back(s);
      }
    }
    v = temp;
  }
  for (long long int i = 0; i < (long long int)v.size(); ++i) {
    cout << v[i] << "\n";
  }
  return 0;
}
