#include <bits/stdc++.h>
using namespace std;
int n;
int a[14];
void saiki(int ind) {
  if (ind == n) {
    for (int i = (0); (i) < (n); (i)++) {
      cout << (char)('a' + a[i]);
    }
    cout << endl;
  } else if (ind == 0) {
    a[ind] = 0;
    saiki(1);
  } else {
    for (int i = 0; i <= a[ind - 1] + 1; i++) {
      a[ind] = i;
      saiki(ind + 1);
    }
  }
}
int main() {
  cin >> n;
  saiki(0);
  return 0;
}
