#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const int INF = (1ll << 30) - 1;
const ll INFLL = 1ll << 60;
const int MOD = 1e9 + 7;
int gcd(int, int);
template <class T>
inline bool chmin(T&, T);
template <class T>
inline bool chmax(T&, T);
int main() {
  int n;
  cin >> n;
  char s[n], e[n];
  for (int(i) = 0; (i) < (n); (i)++) {
    s[i] = 'a';
    e[i] = 'a' + n - i - 1;
    cout << s[i];
  }
  cout << endl;
  char mx = 'a';
  while (s[0] != 'a' + n - 1) {
    for (int(i) = 0; (i) < (n); (i)++) {
      if (i + 1 < n && (s[i] <= s[i + 1] || s[i] <= mx)) {
        s[i]++;
        if (s[i] == e[i]) mx++;
        for (int j = i - 1; j >= 0; j--) {
          s[j] = 'a';
        }
        break;
      }
    }
    for (int j = n - 1; j >= 0; j--) {
      cout << s[j];
    }
    cout << endl;
  }
  return 0;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
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;
}
