#include <bits/stdc++.h>
using namespace std;
vector<string> solve(long N) {
  if (N == 1) return vector<string>(1, "a");
  vector<string> v = solve(N - 1);
  vector<string> ans;
  for (string s : v) {
    string t = "a";
    for (char c : s) t += c + 1;
    ans.push_back("a" + s);
    ans.push_back(t);
  }
  return ans;
}
int main() {
  long N;
  cin >> N;
  vector<string> L = solve(N);
  sort(L.begin(), L.end());
  string x = "";
  for (string s : L) {
    assert(x != s);
    x = s;
    cout << s << endl;
  }
}
