#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  queue<string> base;
  queue<string> add;
  long long cnt = 1;
  base.push("");
  while (cnt <= n) {
    while (!base.empty()) {
      string s = base.front();
      base.pop();
      long long lim;
      if (s.size() == 0)
        lim = 1;
      else
        lim = s[s.size() - 1] - 'a' + 2;
      for (int i = 0; i < ((int)lim); i++) {
        string t = s + char('a' + i);
        add.push(t);
      }
    }
    swap(base, add);
    cnt++;
  }
  while (!base.empty()) {
    string s = base.front();
    base.pop();
    cout << s << endl;
  }
}
