#include <bits/stdc++.h>
using namespace std;
void Ans(bool x) {
  if (x)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
const long long int INF = 1001001001;
const long long int mod = 1000000007;
int main() {
  int n;
  cin >> n;
  queue<string> q;
  q.push("a");
  while (!q.empty()) {
    string s = q.front();
    q.pop();
    if (s.size() == n) {
      cout << s << endl;
      continue;
    }
    char now = s[s.size() - 1];
    now++;
    now++;
    for (char u = 'a'; u < now; u++) {
      q.push(s + u);
    }
  }
}
