#include <bits/stdc++.h>
using namespace std;
set<string> S;
string ans;
int n;
void solve() {
  if (ans.size() == n) {
    S.insert(ans);
    return;
  }
  ans.push_back(ans.back());
  solve();
  ans.pop_back();
  ans.push_back(ans.back() + 1);
  if (ans.back() < 'z') solve();
  ans.pop_back();
}
int main() {
  cin >> n;
  ans = "a";
  solve();
  for (auto s : S) cout << s << '\n';
  return 0;
}
