#include <bits/stdc++.h>
using namespace std;
int N;
char abc[11];
string S = "";
vector<vector<int>> graph(11);
void DFS(int K) {
  S.push_back(abc[K]);
  if (S.size() == N)
    cout << S << endl;
  else {
    for (auto t : graph[K]) DFS(t);
  }
  S.erase(S.size() - 1);
}
int main() {
  cin >> N;
  abc[0] = 'a';
  for (int i = 0; i < N - 1; i++) abc[i + 1] = abc[i] + 1;
  for (int i = 0; i < N; i++)
    for (int j = 0; j <= i + 1; j++) graph[i].push_back(j);
  DFS(0);
  return 0;
}
