#include <bits/stdc++.h>
using namespace std;
long long n;
char ch[12];
void dep(long long now, long long ma) {
  if (now == n) {
    for (long long i = 0; i < n; i++) {
      cout << ch[i];
    }
    cout << endl;
    return;
  }
  for (long long i = 0; i <= ma; i++) {
    ch[now] = i + 'a';
    dep(now + 1, i + 1);
  }
}
int main() {
  cin >> n;
  dep(0, 0);
  return 0;
}
