#include <bits/stdc++.h>
using namespace std;
static mt19937 __gen(chrono::steady_clock::now().time_since_epoch().count());
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
constexpr int inf = 0x3f3f3f3f;
constexpr ll lnf = 0x3f3f3f3f3f3f3f3f;
string s;
int n;
void dfs(int x) {
  if (x == n + 1) {
    cout << s.substr(1) << endl;
    return;
  }
  char l = 'a';
  char r = s.back() + 1;
  for (char i = l; i <= r; ++i) {
    s += i;
    dfs(x + 1);
    s.pop_back();
  }
}
signed main() {
  cin >> n;
  s.push_back('a' - 1);
  dfs(1);
  return 0;
}
