#include <bits/stdc++.h>
using namespace std;
long long jc[20];
long long n;
char a[20];
void solve(long long cur) {
  if (cur > n) {
    for (long long i = 1; i <= n; i++) {
      cout << a[i];
    }
    cout << endl;
    return;
  }
  for (long long i = 'a'; i <= 'a' + cur - 1; i++) {
    a[cur] = i;
    solve(cur + 1);
  }
}
signed main() {
  cin >> n;
  solve(1);
  return 0;
}
