#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int N;
void dfs(string s, char mx) {
  if (s.size() == N) {
    cout << s << endl;
    return;
  }
  for (char c = 'a'; c <= mx + 1; c++) {
    string t = s;
    t += c;
    dfs(t, c);
  }
}
int main() {
  cin >> N;
  string s;
  s.push_back('a');
  dfs(s, 'a');
  return 0;
}
