#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<ll, ll>;
using graph = vector<vector<ll>>;
const long long inf = 2147483647;
const ll INF = 9223372036854775807;
vector<string> ans;
void f(string s, long long n) {
  if (s.size() == n) {
    ans.push_back(s);
    return;
  }
  for (ll i = -1; i < 2; i++) {
    string t = s;
    if (s[s.size() - 1] == 'a' && i == -1) continue;
    t.push_back(s[s.size() - 1] + i);
    f(t, n);
  }
  return;
}
signed main() {
  long long n;
  cin >> n;
  f("a", n);
  for (auto i : ans) cout << i << "\n";
  return 0;
}
