#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n;
char c[11];
void f2(int k, int character) {
  if (k == n) {
    cout << c << endl;
    return;
  }
  for (int i = 0; i < (0 + k); i++) {
    c[k] = 'a' + i;
    f2(k + 1, character);
  }
  c[k] = 'a' + k;
  f2(k + 1, character + 1);
}
int main() {
  cin >> n;
  f2(0, 0);
  return 0;
}
