#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
int main() {
  int N;
  cin >> N;
  char a[N];
  char b[N];
  int add[N];
  int max[N];
  int goal[N];
  for (int i = 0; i < N; i++) {
    a[i] = 'a';
    add[i] = 0;
    max[i] = 1;
    goal[i] = 0;
  }
  int flag = 0;
  int count = N - 1;
  goal[N - 1] = 1;
  for (int j = 0; j < 10000000; j++) {
    flag = 1;
    for (int i = 0; i < N; i++) {
      b[i] = a[i] + add[i];
      cout << b[i];
    }
    if (count == 0) break;
    cout << endl;
    add[N - 1] = add[N - 1] + 1;
    for (int i = 0; i < N; i++) {
      if (goal[i] == add[i])
        flag = flag * 1;
      else
        flag = 0;
    }
    if (flag == 1) {
      for (int k = 0; k < N - count + 1; k++) {
        goal[N - 1 - k]++;
      }
      count = count - 1;
    }
    for (int i = 0; i < N; i++) {
      if (add[N - 1 - i] == N - count + 1) {
        add[N - 1 - i] = 0;
        add[N - 2 - i] = add[N - 2 - i] + 1;
      }
    }
  }
}
