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