#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
void solve(string s) {
  cout << s << endl;
  int k = s.size();
  int d = 0;
  for (int i = (int)(0); i < (int)(k); i++)
    if (s[i] == 'b') {
      d = i;
      break;
    }
  for (int i = k - 1; i >= d + 1; i--) {
    int d = 0;
    for (int j = (int)(0); j < (int)(i); j++) d = max(d, s[j] - 'a');
    if (s[i] - 'a' <= d) {
      s[i]++;
      solve(s);
    }
  }
  if (d != 1) {
    s[d - 1] = 'b';
    for (int i = (int)(d); i < (int)(k); i++) s[i] = 'a';
    solve(s);
  }
}
int main() {
  int N;
  cin >> N;
  string ans = "";
  for (int i = (int)(0); i < (int)(N); i++) ans += 'a';
  solve(ans);
}
