#include <bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int N = 1e5 + 5;
int n;
vector<string> vs;
void go(int k, string s) {
  if (k == n) {
    vs.push_back(s);
    return;
  }
  for (char x = 'a'; x <= s.back() + 1; x++) {
    s.push_back(x);
    go(k + 1, s);
    s.pop_back();
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  go(1, "a");
  sort(begin(vs), end(vs));
  for (auto s : vs) cout << s << "\n";
}
