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