#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long MAX = 2e6 + 7;
const long long dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const long long dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
long long i, j, k, t, n, q, l, r, mid;
vector<string> v;
set<string> st;
string str;
void solve() {
  cin >> n;
  string s = "a";
  st.insert(s);
  n--;
  while (n--) {
    for (auto x : st) {
      str = x;
      long long nn = str.size();
      str += 1 + str[nn - 1];
      v.push_back(str);
      nn++;
      while (str[nn - 1] != 'a') {
        str[nn - 1]--;
        v.push_back(str);
      }
    }
    st.clear();
    for (auto xx : v) st.insert(xx);
    v.clear();
  }
  for (auto x : st) cout << x << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  solve();
  return 0;
}
