#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n;
  queue<string> q;
  q.push("a");
  string s;
  while (!q.empty()) {
    s = q.front();
    q.pop();
    m = s.length();
    if (n == m) {
      cout << s << endl;
    } else {
      int b = (s[m - 1] - 'a');
      for (int i = 0; i <= b + 1; i++) {
        q.push(s + char('a' + i));
      }
    }
  }
  return 0;
}
