#include <bits/stdc++.h>
void solve(int n, int g, std::string& s) {
  if (n == 0) {
    std::cout << s << "\n";
    return;
  }
  for (int i = 0; i <= g + 1; ++i) {
    s += static_cast<char>('a' + i);
    solve(n - 1, i, s);
    s.pop_back();
  }
}
int main() {
  int n;
  std::cin >> n;
  std::string s;
  s.reserve(n);
  s += 'a';
  solve(n - 1, 0, s);
}
