#include <bits/stdc++.h>
using namespace std;
string t;
int n;
bool incr(string& s) {
  int i = n - 1;
  while (i > 0 && s[i] > t[i - 1]) --i;
  if (i == 0) return false;
  ++s[i];
  t[i] = s[i];
  for (int j = i + 1; j < n; ++j) {
    t[j] = t[j - 1];
    s[j] = 'a';
  }
}
signed main() {
  {
    if (fopen("input.txt", "r")) {
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
    }
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    std::cout.tie(NULL);
  }
  cin >> n;
  string s(n, 'a');
  t.resize(n, 'a');
  cout << s << '\n';
  while (incr(s)) {
    cout << s << '\n';
  }
  return 0;
}
