#include <bits/stdc++.h>
using namespace std;
vector<string> ans;
int n;
void dfs(string A) {
  if (A.size() == n) {
    ans.push_back(A);
    return;
  }
  for (int i = 0; i < (int)(A.at(A.size() - 1) - 'a' + 2); ++i) {
    char c = 'a' + i;
    A = A + c;
    dfs(A);
    A.pop_back();
  }
}
int main() {
  cin >> n;
  dfs("a");
  for (int i = 0; i < (int)(ans.size()); ++i) {
    cout << ans.at(i) << endl;
  }
}
