#include <bits/stdc++.h>
using namespace std;
int n, i, ans[16];
int main() {
  cin >> n;
  for (i = 0; i < n; ++i) ans[i] = 0;
  while (!ans[0]) {
    for (i = 0; i < n; ++i) cout << char(ans[i] + 'a');
    cout << '\n';
    i = n - 1;
    while (i > 0 && ans[i] != ans[i - 1]) --i;
    ++ans[i];
  }
  return 0;
}
