#include <bits/stdc++.h>
using namespace std;
const long long INF = 1001001001001001001ll;
const long long LINF = 1001001001001001001ll;
const long long MOD = 1000000007;
const double EPS = 1e-9;
template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  long long len = v.size();
  for (long long i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1) s << ' ';
  }
  return s;
}
template <typename T>
ostream& operator<<(ostream& s, const vector<vector<T>>& vv) {
  long long len = vv.size();
  for (long long i = 0; i < len; ++i) {
    s << vv[i];
    if (i != len - 1) s << '\n';
  }
  return s;
}
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;
}
__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
signed main() {
  long long N;
  cin >> N;
  vector<string> ans;
  for (long long b = 0; b < ((1LL << (N - 1))); ++b) {
    long long num = __builtin_popcount(b);
    vector<long long> A(N - 1);
    for (long long i = 0; i < (N - 1); ++i) {
      if ((b >> i) & 1)
        A[i] = 1;
      else
        A[i] = 0;
    }
    string S = "a";
    char temp = 'a';
    for (long long i = 0; i < (N - 1); ++i) {
      if (A[i]) temp++;
      S.push_back(temp);
    }
    ans.push_back(S);
  }
  sort((ans).begin(), (ans).end());
  for (long long i = 0; i < (((long long)(ans).size())); ++i) {
    cout << ans[i] << endl;
  }
}
