#include <bits/stdc++.h>
int n, f;
char s[15], c;
void dfs(int x) {
  if (x == n) {
    printf("%s\n", s);
    return;
  }
  int t[10];
  for (int i = 0; i < 10; i++) t[i] = 0;
  for (int i = 0; i < x; i++) {
    c = s[i];
    if (t[c - 'a'] == 0) {
      s[x] = c;
      dfs(x + 1);
    }
    t[c - 'a'] = 1;
  }
  f = 0;
  while (t[f]) f++;
  s[x] = f + 'a';
  dfs(x + 1);
}
int main() {
  scanf("%d", &n);
  s[0] = 'a';
  s[n] = NULL;
  dfs(1);
}
