#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll INF = 1LL << 60;
ll n, p;
void dfs(string s, char mx) {
  if (s.size() == n)
    cout << s << '\n';
  else {
    for (char c = 'a'; c <= mx; ++c) {
      dfs(s + c, c + 1);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  dfs("", 'a');
  return 0;
}
