#include <bits/stdc++.h>
using namespace std;
int end, k;
char s[100];
void solve(int end) {
  for (int i = 0; i <= s[end - 1] - 'a' + 1; ++i) {
    s[end] = 'a' + i;
    if (end == k)
      printf("%s\n", s + 1);
    else
      solve(end + 1);
  }
}
int main() {
  scanf("%d", &k);
  ;
  s[1] = 'a';
  solve(2);
}
