#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
void dfs(int n, deque<int>& s) {
  if (n == 0) {
    for (auto&& v : (s)) cout << (char)(v + 'a');
    cout << endl;
    return;
  }
  int top = s.empty() ? -1 : *s.rbegin();
  for (long long i = 0; i < (top + 2); ++i) {
    s.push_back(i);
    dfs(n - 1, s);
    s.pop_back();
  }
}
int main() {
  int n;
  cin >> n;
  deque<int> s;
  dfs(n, s);
}
