#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
int main() {
  int N;
  cin >> N;
  int upper = pow(2, N);
  vector<string> ret;
  for (int b = 0; b < upper; b++) {
    bitset<10> bs(b);
    string s = "";
    char a = 'a';
    char ne = 'b';
    int cnt = 0;
    int bit = 0;
    for (int i = 0; i < N; i++)
      if ((bs >> i)[0]) bit++;
    if (bit <= 1) continue;
    for (int i = 0; i < N; i++) {
      if ((bs >> i)[0])
        s += a;
      else {
        s += ne + cnt;
        cnt++;
      }
    }
    ret.push_back(s);
  }
  string s = "";
  for (int i = 0; i < N; i++) s += 'a' + i;
  ret.push_back(s);
  sort(ret.begin(), ret.end());
  for (string s_ : ret) {
    cout << s_ << '\n';
  }
}
