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