#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);
  for (auto x : mozi) {
    char c = 'a' + x;
    cout << c;
  }
  cout << endl;
  queue<vector<int>> que;
  que.push(mozi);
  while (!que.empty()) {
    bool fuck = 1;
    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]) {
        fuck = 0;
        now[i] += 1;
        que.push(now);
        for (auto x : now) {
          char c = 'a' + x;
          cout << c;
        }
        cout << endl;
        break;
      }
    }
    if (fuck) break;
  }
}
