#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
using P = pair<i64, i64>;
i64 mod = 1000000007;
int int_max = 2147483647;
int max_n = 1e5;
using mat2d_t = std::vector<std::vector<int64_t>>;
void dfs(set<std::string>& m, std::string str, char c, const int N) {
  if (str.size() >= N) {
    m.insert(str);
    return;
  }
  ++c;
  for (; c >= 'a'; --c) {
    string tmp = str + c;
    dfs(m, tmp, c, N);
  }
}
int main(int argc, char** argv) {
  int n;
  cin >> n;
  set<std::string> ans;
  dfs(ans, "a", 'a', n);
  for (auto s : ans) {
    cout << s << endl;
  }
  return 0;
}
