#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  scanf("%d", &N);
  int c = 0;
  string list[512];
  for (int bit = 0; bit < (1 << N - 1); ++bit) {
    string s = "a";
    int count = 97;
    for (int i = 0; i < N - 1; i++) {
      if (bit & 1 << i) {
        count++;
      }
      s += (char)count;
    }
    list[c] = s;
    c++;
  }
  sort(list, list + c);
  for (int i = 0; i < c; i++) {
    printf("%s\n", list[i].c_str());
  }
  return 0;
}
