#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  queue<string> q;
  q.push("a");
  while (q.size() != 0) {
    string s = q.front();
    if (s.size() == n)
      cout << s << endl;
    else {
      int x = s.back();
      for (int i = 'a'; i <= x + 1; i++) q.push(s + (char)i);
    }
    q.pop();
  }
}
