#include <bits/stdc++.h>
using namespace std;
const long long nmax = 1e9 + 7;
const long long Mod = 998244353;
const double PI = 2 * asin(1);
char ans[11][100000];
int cnt[11][100000], before[11][100000];
int main() {
  int N;
  cin >> N;
  ans[0][0] = 'a';
  cnt[0][0] = 1;
  for (int i = 1; i < N; i++) {
    int now = 0;
    for (int j = 0; j < 1e5; j++) {
      if (cnt[i - 1][j] == 0) break;
      for (int k = 0; k <= cnt[i - 1][j]; k++) {
        char next = 'a' + k;
        ans[i][now] = next;
        cnt[i][now] = cnt[i - 1][j];
        if (k == cnt[i - 1][j]) cnt[i][now]++;
        before[i][now] = j;
        now++;
      }
    }
  }
  for (int j = 0; j < 10000; j++) {
    if (cnt[N - 1][j] == 0) break;
    char now[N];
    now[N - 1] = ans[N - 1][j];
    int index = j;
    for (int i = N - 2; i >= 0; i--) {
      index = before[i + 1][index];
      now[i] = ans[i][index];
    }
    for (int i = 0; i < N; i++) {
      cout << now[i];
    }
    cout << endl;
  }
  return 0;
}
