#include <bits/stdc++.h>
using namespace std;
long long n, m;
vector<string> ans;
void solve(int i, string s) {
  if (i == n) {
    ans.push_back(s);
    return;
  }
  char l = s[s.size() - 1];
  for (int j = l; j < 'a' + n; j++) {
    string ns = s + char(j);
    solve(i + 1, ns);
  }
}
int main() {
  cin >> n;
  solve(1, "a");
  for (auto u : ans) {
    cout << u << "\n";
  }
  return 0;
}
