#include <bits/stdc++.h>
using namespace std;
void dfs(vector<long long> ngo, long long d) {
  if (d > 0) {
    for (long long i = 0; i < d; i++) {
      ngo.push_back(i);
      dfs(ngo, d - 1);
      ngo.pop_back();
    }
  } else {
    reverse(ngo.begin(), ngo.end());
    for (long long a : ngo) cout << (char)(a + 'a');
    cout << endl;
  }
}
int main(void) {
  long long n;
  cin >> n;
  dfs(vector<long long>(), n);
}
