#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
void dfs(int len, int n, string s) {
  if (len == n) {
    cout << s << endl;
  } else {
    char last = s[s.size() - 1];
    for (char c = 'a'; c <= last + 1; ++c) {
      dfs(len + 1, n, s + c);
    }
  }
}
int main() {
  int n;
  cin >> n;
  string t = "a";
  dfs(1, n, t);
}
