#include <bits/stdc++.h>
using namespace std;
long long INF = 1e9 + 7;
long long mod = 1e9 + 7;
long long dx[4] = {1, 0, -1, 0};
long long dy[4] = {0, 1, 0, -1};
long long N;
void dfs(char c, string S) {
  if (S.size() == N) {
    cout << S << endl;
    return;
  }
  for (char i = 'a'; i <= c + 1; i++) {
    dfs(i, S + i);
  }
}
signed main() {
  cin >> N;
  dfs('a', "a");
}
