#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll mod = 1000000007;
constexpr int inf = 1000000000;
constexpr ll linf = 1000000000000000000;
int n;
vector<string> ans;
void solve(int i, string s, char mx) {
  if (i == n) {
    ans.push_back(s);
    return;
  }
  for (char c = 'a'; c <= mx + 1; ++c) {
    s[i] = c;
    if (mx == c)
      solve(i + 1, s, mx + 1);
    else
      solve(i + 1, s, mx);
  }
}
int main() {
  cin >> n;
  string s = {};
  for (int i = 0; i < n; ++i) s += 'a';
  solve(1, s, 'a');
  for (auto str : ans) {
    cout << str << endl;
  }
}
