#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = (1ll << 60);
ll n;
set<string> ans;
void dfs(string s) {
  if (s.size() == n) {
    ans.insert(s);
    return;
  }
  for (int i = 0; i < (int)(*s.rbegin() - 'a') + 2; i++) {
    s.push_back((char)('a' + i));
    dfs(s);
    s.pop_back();
  }
}
int main(void) {
  cin >> n;
  string s = "a";
  dfs(s);
  for (auto x : ans) {
    cout << x << endl;
  }
}
