#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n;
vector<string> r;
void form(string s) {
  int m = s.length();
  if (m == n)
    r.push_back(s);
  else {
    for (int i = 0; i <= m; ++i) {
      string s2 = s + (char)(i + 97);
      form(s2);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  form("");
  for (auto c : r) cout << c << '\n';
}
