#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
int n;
ll dfs(string s, char c) {
  if (s.size() == n) {
    cout << s << endl;
    return 0;
  }
  for (char ch = 'a'; ch <= c + 1; ch++) {
    dfs(s + ch, ch);
  }
  return 1;
}
int main() {
  cin >> n;
  dfs("a", 'a');
  return 0;
}
