include <bits/stdc++.h>
using namespace std;

void dfs(int n, string acc = "a") {
  if (acc.size() == n) {
    cout << acc << endl;
    return;
  }
  for (int i = 0; i <= (acc.back() - 'a') + 1; ++i)
    dfs(n, acc + char('a' + i));
}

int main() {
  int n;
  cin >> n;

  dfs(n);
}