#include <bits/stdc++.h>
using vi = std::vector<int>;
using vvi = std::vector<std::vector<int>>;
using vll = std::vector<long long int>;
using vvll = std::vector<std::vector<long long int>>;
using P = std::pair<int, int>;
using vp = std::vector<P>;
using namespace std;
int n;
void dfs(string s, char mx) {
  if (s.size() == n) {
    cout << s << endl;
    return;
  }
  for (char c = 'a'; c <= mx; c++) {
    if (c == s[s.size() - 1])
      dfs(s + c, mx);
    else
      dfs(s + c, mx + 1);
  }
}
int main(void) {
  cin >> n;
  dfs(string(""), 'a');
}
