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