#include <bits/stdc++.h>
using namespace std;
int n;
string s;
void process(int i, int ma) {
  if (i == n + 1) {
    cout << s << "\n";
    return;
  }
  for (int j = 0; j <= ma; ++j) {
    s[i - 1] = ('a' + j);
    process(i + 1, ma + 1);
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) s += '.';
  process(1, 0);
  return 0;
}
