#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
int main() {
  int N;
  cin >> N;
  string s = "";
  queue<string> que;
  que.push(s);
  while (que.front().size() < N) {
    string S = que.front();
    int x = que.front().size();
    que.pop();
    for (int j = 0; j < x + 1; j++) {
      que.push(S + char('a' + j));
    }
  }
  while (!que.empty()) {
    cout << que.front() << endl;
    que.pop();
  }
}
