#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
int ctoi(char c) { return c - '0'; }
class DStringEquivalence {
 public:
  void solve(std::istream& in, std::ostream& out) {
    int N;
    in >> N;
    vector<string> dp[N + 1];
    dp[0].push_back("a");
    for (int i = 1; i < N; i++) {
      for (int j = 0; j < dp[i - 1].size(); j++) {
        for (int k = 0; k <= i; k++) {
          dp[i].push_back(dp[i - 1][j] + char('a' + k));
        }
      }
    }
    for (long long i = 0; i < (dp[N - 1].size()); ++i) {
      out << dp[N - 1][i] << '\n';
    }
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  DStringEquivalence solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
