#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 5;
long long n;
string str = "", aim = "";
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) str.push_back('a');
  for (int i = 0; i < n; i++) aim.push_back(char('a' + i));
  cout << str << endl;
  while (str != aim) {
    str[n - 1] = char(str[n - 1] + 1);
    long long k = 0;
    while ((str[n - 1 - k] - str[n - k - 2]) == 2 && k <= n - 2) {
      str[n - k - 2] = char(str[n - k - 2] + 1);
      str[n - k - 1] = 'a';
      k++;
    }
    cout << str << endl;
  }
  return 0;
}
