#include <bits/stdc++.h>
using namespace std;
int ans[12];
int n;
void dfs(int pos, int ma) {
  if (pos == n + 1) {
    for (int i = 1; i <= n; ++i) printf("%c", ans[i] + 'a');
    printf("\n");
    return;
  }
  int maa;
  for (int i = 0; i <= ma + 1 and i < pos; i++) {
    ans[pos] = i;
    maa = max(i, ma);
    dfs(pos + 1, maa);
  }
}
int main() {
  cin >> n;
  dfs(1, 1);
  return 0;
}
