#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
set<string> ans;
string s;
int n;
void dfs(int d) {
  if (d == n) {
    cout << s << endl;
    return;
  }
  for (int i = 0; i <= d; ++i) {
    s[d] = 'a' + i;
    dfs(d + 1);
  }
}
int main() {
  cin >> n;
  s = string(n, 'a');
  dfs(0);
  return 0;
}
