#include <bits/stdc++.h>
using namespace std;
using P = pair<long long, long long>;
long long n;
void dfs(string s, char mx) {
  if (s.size() == n) {
    cout << s << endl;
    return;
  }
  for (char c = 'a'; c <= mx; c++) {
    string t = s;
    t += c;
    dfs(t, c + 1);
  }
}
signed main() {
  cin >> n;
  dfs("", 'a');
}
