#include <bits/stdc++.h>
using namespace std;
using ll = long long;
char buf[1024];
int MAXN;
int N;
bool test(const string &s) {
  static unordered_set<string> d;
  int cnt = 0;
  unordered_map<char, int> mm;
  string res;
  for (auto i : s) {
    if (mm.count(i)) {
      res += to_string(mm[i]);
    } else {
      mm[i] = cnt++;
      res += to_string(cnt++);
    }
  }
  if (d.count(res)) {
    return false;
  } else {
    d.insert(res);
    return true;
  }
}
void dfs(int now) {
  if (now == MAXN) {
    for (int i = 0; i < MAXN; i++) {
      cout << buf[i];
    }
    cout << endl;
    return;
  }
  for (int i = 0; i < now + 1; i++) {
    buf[now] = 'a' + i;
    dfs(now + 1);
  }
}
int main() {
  cin >> MAXN;
  dfs(0);
}
