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