#include <bits/stdc++.h>
using namespace std;
const long long int INF = (long long int)(1e18) + 1;
const int INF_INT = 2147483647 - 1e6;
const long long int mod = 1000000007ll;
int N;
vector<string> ans;
void add_string(string now, int ns) {
  if (now.size() == N) {
    ans.push_back(now);
    return;
  }
  string ret = now;
  for (int i = 0; i <= ns; i++) {
    add_string(now + char(i + 'a'), i + 1);
  }
}
void solve() { add_string("a", 1); }
int main() {
  cin >> N;
  solve();
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
  return 0;
}
