#include <bits/stdc++.h>
using namespace std;
int n;
char s[12];
void dfs(int now, int mx) {
  if (now == n + 1) {
    printf("%s\n", s + 1);
    return;
  }
  if (mx >= 0) {
    s[now] = ('a' + mx);
    dfs(now + 1, mx);
  }
  s[now] = ('a' + mx + 1);
  dfs(now + 1, mx + 1);
}
int main() {
  cin >> n;
  dfs(1, -1);
}
