#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll INF = 1LL << 60;
ll n, p;
void dfs(int i, string s) {
  if (i == n)
    cout << s << '\n';
  else {
    for (int j = 0; j <= i; ++j) {
      dfs(i + 1, s + (char)('a' + j));
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  dfs(1, "a");
  return 0;
}
