#include <bits/stdc++.h>
using namespace std;
void dfs(int nowth, int n, string ans) {
  int len = ans.length();
  if (nowth == n) {
    cout << ans << endl;
  } else {
    for (int i = 0; i <= len; i++) {
      string temp = ans + char('a' + i);
      dfs(nowth + 1, n, temp);
    }
  }
  return;
}
int main() {
  int n;
  while (cin >> n) {
    dfs(0, n, "");
  }
  return 0;
}
