#include <bits/stdc++.h>
using namespace std;
template <class T>
inline int out(const T &t) {
  print(t);
  putchar('\n');
  return 0;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return (gcd(b, a % b));
}
template <class T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
const long long INF = 1e18;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
void solve(long long N) {
  vector<vector<string>> v(N);
  v[0].push_back("a");
  for (long long i = 1; i < N; i++) {
    for (long long j = 0; j < v[i - 1].size(); j++) {
      char last = v[i - 1][j].at(i - 1);
      for (long long k = 0; k < last - 'a' + 2; k++) {
        char addc = 'a' + k;
        v[i].push_back(v[i - 1][j] + addc);
      }
    }
  }
  for (long long i = 0; i < v[N - 1].size(); i++) {
    cout << v[N - 1][i] << endl;
  }
}
int main() {
  long long N;
  scanf("%lld", &N);
  solve(N);
  return 0;
}
