#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<char> chararr;
  chararr.push_back('a');
  chararr.push_back('b');
  chararr.push_back('c');
  chararr.push_back('d');
  chararr.push_back('e');
  chararr.push_back('f');
  chararr.push_back('g');
  chararr.push_back('h');
  chararr.push_back('i');
  chararr.push_back('j');
  chararr.push_back('k');
  chararr.push_back('l');
  queue<string> que;
  que.push("a");
  string state;
  while (!que.empty()) {
    state = que.front();
    que.pop();
    if (state.size() == N) {
      cout << state << endl;
      continue;
    }
    for (int i = 0; i < state.size() + 1; ++i) {
      que.push(state + chararr[i]);
    }
  }
}
