#include <bits/stdc++.h>
using ll = long long;
using namespace std;
long long N;
void func(long long depth, char max, char str[11]) {
  if (depth == N - 1) {
    cout << "a" << str << endl;
    return;
  }
  for (char c = 'a'; c <= max + 1; c++) {
    str[depth] = c;
    func(depth + 1, c, str);
  }
}
signed main() {
  cin >> N;
  char str[11] = {};
  func(0, 'a', str);
}
