#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<string> ans;
  ans.push_back(string(n, 'a'));
  for (int i = 0; i < (n - 1); i++) {
    vector<int> v(n);
    v[i] = 1;
    string s(n, 'a');
    s[i] = 'a' + v[i];
    reverse((s).begin(), (s).end());
    ans.push_back(s);
    int x = i + 1;
    int j = 0;
    while (v[0] != i + 1) {
      if (v[j + 1] != 0) {
        v[0] = x;
        x++;
      } else {
        v[j + 1] = v[j];
        v[j] = 0;
      }
      string s1;
      for (int k = 0; k < (v.size()); k++) s1.push_back('a' + v[k]);
      reverse((s1).begin(), (s1).end());
      ans.push_back(s1);
    }
  }
  for (int i = 0; i < (ans.size()); i++) cout << ans[i] << '\n';
  return 0;
}
