#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
inline bool chmax(T& a, U b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T, class U>
inline bool chmin(T& a, U b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  set<string> ans;
  stack<string> sta;
  sta.emplace("a");
  while (!sta.empty()) {
    string s = sta.top();
    sta.pop();
    int m = s.size();
    if (m == n)
      ans.emplace(s);
    else {
      char last = s[m - 1];
      for (char c = 'a'; c <= last + 1; c++) {
        sta.emplace(s + c);
      }
    }
  }
  vector<string> v;
  for (const auto& e : ans) v.emplace_back(e);
  sort(v.begin(), v.end());
  for (const auto& e : v) cout << e << '\n';
  return 0;
}
