#include <bits/stdc++.h>
using namespace std;
vector<string> MakeHyojunkei(int K) {
  if (K == 1)
    return {"a"};
  else {
    vector<string> buf = MakeHyojunkei(K - 1);
    vector<string> ans;
    for (string s : buf) {
      for (char c = 'a'; c <= s[s.length() - 1] + 1; c++) {
        ans.push_back(s + c);
      }
    }
    return ans;
  }
}
int main() {
  int N;
  cin >> N;
  vector<string> ans = MakeHyojunkei(N);
  for (string s : ans) cout << s << endl;
}
