#include <bits/stdc++.h>
using namespace std;
template <typename T>
string tost(const T& n) {
  ostringstream stm;
  stm << n;
  return stm.str();
}
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 const INF = 1001001001;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  if (N == 1) {
    cout << "a" << endl;
    return 0;
  }
  vector<string> ans = {};
  for (int bit = 0; bit < (1 << N - 1); ++bit) {
    string s;
    s.resize(N);
    vector<int> A(N, 0);
    for (int i = 0; i < N - 1; ++i) {
      if (bit & (1 << i))
        A[i + 1] = A[i] + 1;
      else
        A[i + 1] = A[i];
    }
    for (int i = 0; i < (N); ++i) s[i] = 'a' + A[i];
    ans.push_back(s);
  }
  sort((ans).begin(), (ans).end());
  for (int i = 0; i < (ans.size()); ++i) cout << ans[i] << endl;
  return 0;
  return 0;
}
