#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  queue<string> q;
  q.push("a");
  for (int i = 0; i < n - 1; i++) {
    int j = q.size();
    for (int i = 0; i < j; i++) {
      string s = q.front();
      q.pop();
      char c = s[s.size() - 1];
      for (int k = 97; k < (int)c + 2; k++) {
        string t = s + (char)k;
        q.push(t);
      }
    }
  }
  while (q.size()) {
    string u = q.front();
    cout << u << endl;
    q.pop();
  }
}
