#include <bits/stdc++.h>
using namespace std;
int n;
char a[15];
void DFS(int now, int lst) {
  if (now == n) {
    cout << a << endl;
    return;
  }
  for (int i = 'a'; i <= lst + 1 && i <= now + 'a'; i++)
    a[now] = i, DFS(now + 1, i);
}
int main() {
  cin >> n;
  DFS(0, 'a' + n - 2);
}
