#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll INF = 1LL << 60;
ll n, p;
string s;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  ll m = n;
  vector<string> ans;
  ans.push_back("a");
  while (--m) {
    vector<string> tmp = ans;
    for (auto a : ans) {
      tmp.push_back("a" + a);
      string t = "";
      for (auto c : a) t += (c + 1);
      tmp.push_back("a" + t);
    }
    ans = tmp;
  }
  sort(ans.begin(), ans.end());
  ans.erase(unique(ans.begin(), ans.end()), ans.end());
  for (auto a : ans)
    if (a.size() == n) cout << a << '\n';
  return 0;
}
