#include <bits/stdc++.h>
using namespace std;
int n;
vector<string> ans;
string lis[] = {"a", "b", "c", "d", "e", "f", "g",
                "h", "i", "j", "k", "l", "m", "n"};
void solve(string s, int num, int ma) {
  if (num - 1 == n) {
    ans.push_back(s);
    return;
  }
  char c = s[s.size() - 1];
  int k = c - 'a';
  for (int i = 0; i <= k + 1; i++) {
    string p = lis[i];
    solve(s + p, num + 1, max(ma, i));
  }
  return;
}
int main() {
  cin >> n;
  string s = "a";
  if (n == 1) {
    cout << s << endl;
  } else {
    solve(s, 2, 0);
  }
  sort(ans.begin(), ans.end());
  string pre = "";
  for (int i = 0; i < ans.size(); i++) {
    if (ans[i] == pre) {
      continue;
    } else {
      cout << ans[i] << endl;
      pre = ans[i];
    }
  }
}
