#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
int n, m, t;
int v[MAXN];
string s;
string ans;
int use[MAXN];
int check() {
  for (int i = 0; i <= 10; i++) use[i] = 0;
  for (int i = 0; i <= n - 1; i++) use[s[i] - 'a']++;
  int sum;
  for (int i = 0; i <= 10; i++)
    if (use[i]) sum++;
  return sum;
}
void change() {
  int tmp = check();
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] - 'a' <= tmp && use[s[i] - 'a'] > 1) {
      s[i]++;
      break;
    }
  }
}
int main() {
  cin >> n;
  for (int i = 0; i <= n - 1; i++) {
    ans.push_back('a' + i);
    s.push_back('a');
  }
  cout << s << endl;
  while (ans != s) {
    change();
    cout << s << endl;
  }
}
