#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void coY() { cout << "Yes" << endl; }
void coN() { cout << "No" << endl; }
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;
}
const ll INF = 1LL << 60;
int main() {
  int n;
  cin >> n;
  vector<int> mozi(n, 0);
  vector<vector<int>> ans(0);
  queue<vector<int>> que;
  que.push(mozi);
  ans.push_back(mozi);
  while (!que.empty()) {
    vector<int> look = que.front();
    que.pop();
    for (int i = n - 1; i > 0; i--) {
      vector<int> now = look;
      if (now[i] == now[i - 1]) {
        now[i] += 1;
        que.push(now);
        ans.push_back(now);
      }
    }
  }
  sort(ans.begin(), ans.end());
  for (auto x : ans) {
    for (auto y : x) {
      char c = 'a' + y;
      cout << c;
    }
    cout << endl;
  }
}
