#include <bits/stdc++.h>
std::vector<std::string> ans;
void rec(std::string vec_c, char max_c, int n) {
  if (vec_c.size() == n) {
    ans.push_back(vec_c);
    return;
  }
  for (char c = 'a'; c <= max_c + 1; ++c) {
    vec_c.push_back(c);
    rec(vec_c, max_c + 1, n);
    vec_c.pop_back();
  }
}
int main(void) {
  int n;
  std::cin >> n;
  rec("a", 'a', n);
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); ++i) std::cout << ans[i] << std::endl;
  return 0;
}
