#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
  long long n;
  cin >> n;
  vector<string> ans;
  string x = "";
  for (long long i = 0; i < n; i++) {
    x.push_back('a');
  }
  long long k = n - 1;
  ans.push_back(x);
  string copy = x;
  long long num = 0;
  long long judge = 0;
  while (judge < n) {
    while (num < ans.size()) {
      x = ans[num];
      copy = x;
      while (k > 0) {
        bool ok = false;
        copy[k] = 'b';
        k--;
        for (long long i = 0; i < ans.size(); i++) {
          if (copy == ans[i]) {
            ok = true;
          }
        }
        if (ok) {
          copy = x;
          continue;
        }
        ans.push_back(copy);
        copy = x;
      }
      k = n - 1;
      num++;
    }
    num = 0;
    judge++;
  }
  sort(ans.begin(), ans.end());
  for (long long i = 1; i < ans.size(); i++) {
    if (ans[i - 1] == ans[i]) {
      ans[i - 1] = "z";
    }
  }
  sort(ans.begin(), ans.end());
  for (long long i = 0; i < ans.size(); i++) {
    if (ans[i] == "z") break;
    cout << ans[i] << endl;
  }
}
