#include <bits/stdc++.h>
using namespace std;
void func(char *st, int i, int n, char last) {
  if (i == n) {
    st[i] = '\0';
    cout << st << "\n";
    return;
  }
  for (char j = 'a'; j <= last + 1; j++) {
    st[i] = j;
    func(st, i + 1, n, max(j, last));
  }
}
int main() {
  int n;
  char st[11];
  cin >> n;
  func(st, 0, n, 'a' - 1);
}
