#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
long long n, ans = 0;
void dfs(string s, char mx) {
  if (s.size() == n) {
    cout << s << endl;
    return;
  }
  for (char i = 'a'; i <= mx + 1; ++i) {
    string t = s;
    t += i;
    dfs(t, max(mx, i));
  }
}
int main() {
  cin >> n;
  dfs("", 'z');
  return 0;
}
