#include <bits/stdc++.h>
using namespace std;
vector<string> v;
int n;
void f(string s, int last, int len) {
  if (len == n) {
    v.push_back(s);
    return;
  }
  string s1 = s + 'a';
  f(s1, last, len + 1);
  s1 = s + (char)(last + 1 + 'a');
  f(s1, last + 1, len + 1);
}
int main() {
  cin >> n;
  f("", -1, 0);
  sort(v.begin(), v.end());
  set<string> s;
  for (auto i : v) s.insert(i);
  for (auto i : s) cout << i << '\n';
  return 0;
}
