#include <bits/stdc++.h>
using namespace std;
int n;
string s;
void dfs(int now, int t) {
  if (now == t) {
    cout << s << endl;
    return;
  }
  s.push_back(s.back());
  dfs(now + 1, t);
  s.pop_back();
  s.push_back(s.back() + 1);
  dfs(now + 1, t);
  s.pop_back();
}
int main() {
  cin >> n;
  s.push_back('a');
  dfs(1, n);
  return 0;
}
