#include <bits/stdc++.h>
using namespace std;
set<string> ans;
int n;
void dfs(int cur, int g, string s) {
  if (cur == n) {
    ans.insert(s);
    return;
  }
  for (int i = 0; i <= g + (cur > 0); i++) {
    s.push_back('a' + i);
    dfs(cur + 1, i, s);
    s.pop_back();
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  dfs(0, 0, "");
  for (auto& s : ans) {
    cout << s << '\n';
  }
  return 0;
}
