#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = 1e9 + 7;
void DFS(int depth, int end, string s) {
  if (depth == end) {
    cout << s << endl;
    return;
  }
  if (!s.size())
    DFS(1, end, "a");
  else {
    int last = int(s.at(s.size() - 1) - 'a');
    for (int i = 0; i < (int)(last + 2); i++) {
      DFS(depth + 1, end, s + (char)(i + 'a'));
    }
  }
}
int main() {
  int N;
  cin >> N;
  DFS(0, N, "");
}
