#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcd(long long a, long long b) {
  if (b == 0) return a;
  return (a / gcd(a, b)) * b;
}
vector<int> divnum(long long num) {
  int dig;
  vector<int> p;
  while (num) {
    dig = num % 10;
    p.push_back(dig);
    num /= 10;
  }
  return p;
}
int digiter(long long num) {
  int dig;
  vector<int> p;
  while (num) {
    dig = num % 10;
    p.push_back(dig);
    num /= 10;
  }
  return p.size();
}
vector<int> convert(string s) {
  vector<int> d;
  long long n = s.size();
  for (int i = 0; i < n; i++) {
    d.push_back(s[i] - '0');
  }
  return d;
}
int N;
vector<string> alf[12];
string s;
int mover(string s, char word, int till) {
  for (int pos = N - 1; pos > till; pos--) {
    s[pos] = word;
    if (pos < N - 1) {
      string t = s;
      t.replace(pos + 1, N - 1, s);
      t.erase(t.begin() + N, t.end());
      cout << t << endl;
      mover(t, word + 1, pos + 1);
    }
    cout << s << endl;
    mover(s, word + 1, pos);
  }
}
int main() {
  cin >> N;
  char a = 'a';
  for (int i = 0; i < N; i++) {
    s += 'a';
  }
  cout << s << endl;
  mover(s, 'b', 0);
}
