#include <bits/stdc++.h>
using namespace std;
const long long INF = 1010000000000000017LL;
const long long MOD = 1000000007LL;
void func(int N, string cur, char last, int depth) {
  if (depth == N) {
    cout << cur << endl;
    return;
  }
  for (char c = 'a'; c <= last + 1; c++) {
    func(N, cur + c, c, depth + 1);
  }
}
int main() {
  std::cout << std::fixed << std::setprecision(10);
  long long N;
  cin >> N;
  func(N, "a", 'a', 1);
}
