#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  ll A = 0;
  for (int i = 0; i < N; i++) {
    A *= 10;
    A += i;
  }
  Vi a(N);
  while (1) {
    bool endf = false;
    for (int j = 0; j < N; j++) {
      cout << (char)(a[j] + 'a');
    }
    cout << '\n';
    for (int j = N - 1; j >= 1; j--) {
      if (a[j - 1] >= a[j]) {
        ++a[j];
        break;
      } else {
        a[j] = 0;
      }
      if (j == 1) {
        endf = true;
      }
    }
    if (endf) break;
  }
  return 0;
}
