#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll n;
template <class T>
void printVector(const vector<T>& v) {
  for (auto value : v) {
    cout << value << " ";
  }
  cout << endl;
}
void dfs(string alphabets, char mx) {
  if (alphabets.size() == n) {
    ;
    return;
  }
  for (char c = 'a'; c <= mx + 1; c++) {
    string s = alphabets;
    s += c;
    dfs(s, max(c, mx));
  }
}
int main() {
  cin >> n;
  dfs("", 'a' - 1);
  return 0;
}
