#include <bits/stdc++.h>
using namespace std;
int n;
string s;
void rec(int r, int pos) {
  if (pos == n) {
    cout << s << endl;
    return;
  }
  for (int i = 0; i < int(r + 1); ++i) {
    s[pos] = char('a' + i);
    rec(r + 1, pos + 1);
  }
}
int main(void) {
  cin >> n;
  s = string(n, ' ');
  rec(0, 0);
  return 0;
}
