#include <bits/stdc++.h>
using namespace std;
long long int MOD = 1000000007;
long long int INFL = 1ll << 60;
long long int INF = 1 << 28;
vector<int> v(10, 0);
template <typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
  cout << "{";
  for (int i = 0; i < vec.size(); i++)
    os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  cout << "}";
  return os;
}
bool owari = false;
void next(int p) {
  if (p == 0) {
    owari = true;
    return;
  }
  if (v[p - 1] + 1 == v[p]) {
    v[p] = 0;
    next(p - 1);
  } else {
    v[p]++;
    for (int i = 0; i < v.size(); i++) {
      cout << (char)(v[i] + 'a');
    }
    cout << endl;
  }
}
int main() {
  int n;
  cin >> n;
  v.resize(n);
  for (int i = 0; i < n; i++) cout << "a";
  cout << endl;
  while (!owari) next(n - 1);
}
