#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
char s[11];
char s1[11];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) s[i] = 'a';
  for (int i = 0; i < n; i++) s1[i] = 'a' + i;
  printf("%s\n", s);
  while (1) {
    s[n - 1]++;
    for (int i = n - 1; i >= 1; i--) {
      if (s[i] > s1[i]) {
        s[i] = 'a';
        s[i - 1]++;
      }
    }
    if (s[0] == 'b') break;
    printf("%s\n", s);
  }
}
