#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;
int main() {
  int N;
  cin >> N;
  vector<string> res;
  queue<string> que;
  que.push("a");
  while (!que.empty()) {
    string s = que.front();
    que.pop();
    if (s.size() == N) {
      res.push_back(s);
      continue;
    }
    que.push(s + s.back());
    que.push(s + (char)(s.back() + 1));
  }
  for (int(i) = 0; (i) < (res.size()); (i)++) {
    cout << res[i] << endl;
  }
  return 0;
}
