#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout.setf(ios::fixed);
  cout.precision(10);
  int N;
  cin >> N;
  queue<string> Q;
  Q.push("a");
  set<string> ST;
  ST.insert("a");
  while (true) {
    string s = Q.front();
    if (s.size() > N) break;
    Q.pop();
    char left = max('a', (char)(s.back() - 1));
    char right = (char)(s.back() + 1);
    for (char c = left; c <= right; ++c) {
      string temp = s + string(1, c);
      Q.push(temp);
      ST.insert(temp);
    }
  }
  for (auto& item : ST) {
    if (item.size() == N) {
      cout << item << "\n";
    }
  }
}
