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