#include <bits/stdc++.h>
using namespace std;
int N;
set<int> check_set;
void process(int depth, string str) {
  if (depth == N) {
    bitset<11> check;
    for (int i = 0; i < str.size() - 1; i++) {
      if (str[i] != str[i + 1]) {
        check[i] = 1;
      }
    }
    if (check_set.find(check.to_ulong()) == check_set.end()) {
      check_set.insert(check.to_ulong());
      cout << str << "\n";
    }
    return;
  }
  for (char i = 'a'; i < 'a' + N; i++) {
    string next = str;
    next.push_back(i);
    process(depth + 1, next);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> N;
  if (N == 1) {
    cout << "a";
    return 0;
  }
  process(0, "");
  return 0;
}
