#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
void solve() {
  int n;
  cin >> n;
  vector<string> dp = {"a"};
  for (int i = 0; i < n - 1; i++) {
    vector<string> tdp;
    for (auto &item : dp) {
      for (int j = 0; j <= (i + 1); j++) {
        string temp = item;
        if ((j + 'a' - item.back()) > 1) break;
        temp.push_back(j + 'a');
        tdp.push_back(temp);
      }
    }
    dp = tdp;
  }
  for (auto &item : dp) {
    cout << item << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
