#include <bits/stdc++.h>
using namespace std;
queue<string> a;
int main() {
  int n;
  cin >> n;
  a.push("a");
  while (!a.empty()) {
    if (a.front().size() == n) break;
    for (char i = (char)('a'); i < (char)('a' + a.front().size() + 1); i++)
      a.push(a.front() + i);
    a.pop();
  }
  while (!a.empty()) cout << a.front() << endl, a.pop();
  return 0;
}
