#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<ll, ll>;
vector<string> que;
int n;
void dfs(string s) {
  if (s.size() == n) {
    que.push_back(s);
    return;
  }
  for (char c = 'a'; c <= (s[s.size() - 1] + 1); c++) {
    string t = s + c;
    dfs(t);
  }
}
int main() {
  cin >> n;
  string t = "a";
  dfs(t);
  sort((que).begin(), (que).end());
  for (string s : que) {
    cout << s << endl;
  }
}
