#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
const int64 INF = (1LL << 60);
int N;
void back(int at, int x, string S) {
  if (at == N) {
    cout << S << "\n";
    return;
  }
  for (int i = 0; i <= x + 1; i++) {
    back(at + 1, i, S + string(1, 'a' + i));
  }
}
int main() {
  cin >> N;
  back(0, -1, "");
  return 0;
}
