#include <bits/stdc++.h>
using namespace std;
void search(string s, int n) {
  if (n == 1) {
    cout << s << endl;
    return;
  }
  for (char c = 'a'; c < s.at(s.length() - 1) + 2; c++) {
    if (s.length() + 1 < n)
      search(s + c, n);
    else if (s.length() + 1 == n)
      cout << s + c << endl;
  }
}
int main() {
  int n;
  cin >> n;
  search("a", n);
}
