#include <bits/stdc++.h>
using namespace std;
long long n;
void dfs(long long i, char maxc, string ans) {
  if (i == n) {
    cout << ans << endl;
    return;
  }
  for (char c = 'a'; c <= maxc; c++) {
    dfs(i + 1, maxc + 1, ans + c);
  }
}
signed main() {
  cin >> n;
  dfs(0, 'a', "");
}
