#include <bits/stdc++.h>
using namespace std;
long long N;
void dfs(string s, char M) {
  long long sl = s.size();
  if (sl == N) {
    cout << s << endl;
    return;
  }
  for (long long i = 0; i <= M - 'a' + 1; ++i) {
    dfs(s + (char)('a' + i), max(M, (char)('a' + i)));
  }
}
int main() {
  cin >> N;
  dfs("a", 'a');
}
