#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> a;
void rec(long long i = 0, long long r = 0) {
  if (i == n) {
    for (long long j = 0; j < n; j++) {
      cout << (char)(a[j] + 'a');
    }
    cout << "\n";
    return;
  }
  for (long long j = 0; j <= r; j++) {
    a.push_back(j);
    rec(i + 1, j + 1);
    a.pop_back();
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n;
  rec();
  return 0;
}
