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