#include <bits/stdc++.h>
using namespace std;
int n;
vector<string> s(0);
void dfs(char c, string t) {
  if (t.size() == n) {
    s.emplace_back(t);
    return;
  }
  for (char i = 'a'; i <= c + 1; i++) {
    string tmp = t;
    tmp.push_back(i);
    dfs(i, tmp);
  }
  return;
}
int main() {
  cin >> n;
  dfs('a', "a");
  for (int i = 0; i < (int)(s.size()); i++) {
    cout << s[i] << endl;
  }
  return 0;
}
