#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int iINF = 1001001001;
const long long llINF = 1LL << 60;
vector<string> ans;
void rec(int n, int num, string str) {
  if (n == num) {
    ans.push_back(str);
    return;
  }
  for (int i = 0; i < (num + 1); ++i) {
    if (num != 0) {
      if (1 < i - (str.back() - 'a')) break;
    }
    rec(n, num + 1, str + char('a' + i));
  }
  return;
}
int main() {
  int n;
  cin >> n;
  rec(n, 0, "");
  for (string s : ans) cout << s << endl;
  return 0;
}
