#include <bits/stdc++.h>
using namespace std;
void solve(int n, string s, vector<string>& result) {
  if (n == 0) {
    result.push_back(s);
    return;
  }
  solve(n - 1, s + s[s.size() - 1], result);
  solve(n - 1, s + char(s[s.size() - 1] + 1), result);
}
int main() {
  int n;
  cin >> n;
  vector<string> result;
  solve(n - 1, "a", result);
  sort(result.begin(), result.end());
  for (auto r : result) {
    cout << r << endl;
  }
  return 0;
}
