#include <bits/stdc++.h>
using namespace std;
void dfs(string head, int pos, int len) {
  if (len == 0) {
    cout << head << endl;
    return;
  }
  for (char i = 0; i <= pos; i++) {
    char c = 'a' + i;
    dfs(head + c, pos + 1, len - 1);
  }
}
int main() {
  int n;
  cin >> n;
  dfs("", 0, n);
}
