#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
vector<string> solve(int n, string s) {
  vector<string> res;
  for (char c = 'a'; c <= (char)(s.back() + 1); ++c) {
    string tmp = s;
    tmp.push_back(c);
    if (tmp.size() == n) {
      res.push_back(tmp);
    } else {
      auto v = solve(n, tmp);
      for (auto e : v) {
        res.push_back(e);
      }
    }
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << "a" << endl;
    return 0;
  }
  vector<string> ans = solve(n, "a");
  sort(ans.begin(), ans.end());
  for (auto s : ans) {
    cout << s << endl;
  }
  return 0;
}
