#include <bits/stdc++.h>
using namespace std;
vector<string> res;
int n;
void dfs(int cnt, string s, char mx) {
  if (cnt == n) {
    res.push_back(s);
    return;
  }
  for (char c = 'a'; c <= mx; ++c) {
    dfs(cnt + 1, s + c, mx + 1);
  }
}
int main() {
  cin >> n;
  dfs(0, "", 'a');
  for (string x : res) cout << x << endl;
}
