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