#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
inline bool chmax(A &a, const B &b) {
  return b > a && (a = b, true);
}
template <class A, class B>
inline bool chmin(A &a, const B &b) {
  return b < a && (a = b, true);
}
const int INF = 1 << 30;
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, -1, 0, 1, 1, -1, -1, 1};
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  char s[11] = {"abcdefghij"};
  int n;
  cin >> n;
  vector<pair<int, int> > stan;
  for (int i = 0; i < n; i++) {
    stan.emplace_back(i, 0);
  }
  int flag = n - 1;
  while (true) {
    flag = n - 1;
    for (int i = 0; i < n; i++) {
      cout << s[stan[i].second];
    }
    cout << '\n';
    while (stan[flag].first == stan[flag].second) {
      for (int i = n - 1; i >= flag; i--) {
        stan[i].second = 0;
      }
      if (flag == 0) {
        break;
      }
      flag--;
    }
    if (flag == 0) {
      break;
    }
    stan[flag].second++;
  }
  return (0);
}
