#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int N = 1024;
const int INF = INT32_MAX - 1;
const double EPS = 1E-9;
int a[N];
int n, m;
vector<string> dfs(int n) {
  vector<string> res;
  if (n == 1) {
    res.push_back("a");
    return res;
  }
  for (auto v : dfs(n - 1)) {
    char m = 'a';
    for (auto c : v) {
      m = max(c, 'a');
    }
    for (char u = 'a'; u <= m + 1; ++u) {
      res.push_back(v + u);
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  auto res = dfs(n);
  for (auto v : res) {
    cout << v << "\n";
  }
  return 0;
}
