#include <bits/stdc++.h>
using namespace std;
const int N = 14;
int n;
int s[N];
void dfs(int len, int up) {
  if (len == n + 1) {
    for (int i = 1; i <= n; i++) putchar(s[i] + 'a');
    putchar('\n');
    return;
  }
  for (int i = 0; i <= up; i++) {
    s[len] = i;
    dfs(len + 1, min(25, up + 1));
  }
}
int main() {
  scanf("%d", &n);
  dfs(1, 0);
}
