#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
long long N;
set<string> ans;
void dfs(int cnt, string s = "") {
  if (cnt == N - 1) {
    ans.insert(s);
    return;
  }
  int last = s[s.size() - 1] - 'a';
  for (int k = 0; k <= last + 1; k++) {
    string target = s;
    target.push_back('a' + k);
    dfs(cnt + 1, target);
  }
}
int main() {
  cin >> N;
  dfs(0, "a");
  for (auto s : ans) {
    cout << s << endl;
  }
}
