#include <bits/stdc++.h>
using namespace std;
void normal(string s, long long req, long long temp) {
  if (req == 0) {
    cout << s << endl;
    return;
  }
  for (long long i = 0; i <= temp; i++) {
    char ch = 'a' + (int)i;
    string s1 = s;
    s += ch;
    normal(s, req - 1, i + 1);
    s = s1;
  }
}
int main() {
  long long n;
  cin >> n;
  string s = "a";
  normal(s, n - 1, 1);
}
