#include <bits/stdc++.h>
using namespace std;
int n;
void dfs(string s, set<string> &list) {
  if (s.size() == n) {
    list.insert(s);
    return;
  }
  dfs(s + s[0], list);
  dfs(s + s[s.size() - 1], list);
  dfs(s + char(s[s.size() - 1] + 1), list);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  set<string> list;
  dfs("a", list);
  for (auto x : list) {
    cout << x << endl;
  }
  return 0;
}
