#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9 + 7;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  cout << fixed << setprecision(10);
  int n;
  cin >> n;
  queue<string> que;
  que.push("a");
  int cnt = 1;
  set<string> ans;
  while (1) {
    string fa = que.front();
    if (fa.size() == n) ans.insert(fa);
    que.pop();
    if (fa.size() > n) break;
    for (int i = 0; i < (fa.size() + 1); i++) {
      que.push(fa + char('a' + i));
    }
    cnt++;
  }
  for (auto u : ans) {
    cout << u << endl;
  }
  return 0;
}
