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