#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  long long n;
  cin >> n;
  vector<string> res = {"a"};
  for (int i = 0; i < (n - 1); i++) {
    vector<string> res_tmp = {};
    for (string s : res) {
      char c = s[s.size() - 1];
      for (char next = 'a'; next <= c + 1; next++) {
        res_tmp.push_back(s + next);
      }
    }
    res = res_tmp;
  }
  for (string s : res) {
    cout << s << endl;
  }
}
