#include <bits/stdc++.h>
using namespace std;
int64_t N;
void dfs(string s) {
  if (s.size() == N) {
    cout << s << endl;
    return;
  }
  for (char c = 'a'; c <= s[s.size() - 1] + 1; c++) {
    string next_s = s + c;
    dfs(next_s);
  }
}
int main() {
  cin >> N;
  string S = "a";
  dfs(S);
}
