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