#include <bits/stdc++.h>
using namespace std;
char a[20];
int n;
void f(int k) {
  if (k > n) return;
  int d = 0;
  while (d < k - 1) {
    f(k + 1);
    a[k]++;
    for (int i = 1; i <= n; i++) cout << a[i];
    cout << endl;
    d++;
    if (a[k] > a[k - 1]) break;
  }
  f(k + 1);
  a[k] = 'a';
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) a[i] = 'a';
  for (int i = 1; i <= n; i++) cout << a[i];
  cout << endl;
  f(2);
}
