#include <bits/stdc++.h>
using namespace std;
int N;
void dfs(string s) {
  if (s.size() == N) {
    cout << s << endl;
    return;
  }
  char moji = 'a';
  for (char c : s) {
    moji = max(c, moji);
  }
  for (char str = 'a'; str <= moji + 1; str++) {
    s += str;
    dfs(s);
  }
}
int main() {
  cin >> N;
  dfs("a");
  return 0;
}
