#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
const ll INF = 999999999999999;
ll n;
vector<string> ans;
void dfs(string s, char c) {
  s.push_back(c);
  if (s.size() == n) {
    ans.push_back(s);
    return;
  }
  dfs(s, c);
  if (c + 1 <= 'z') dfs(s, c + 1);
  if (c - 1 >= 'a') dfs(s, c - 1);
}
int main() {
  cin >> n;
  dfs("", 'a');
  sort(ans.begin(), ans.end());
  for (ll i = 0; i < (ll)ans.size(); ++i) cout << ans.at(i) << "\n";
  return 0;
}
