#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using ll = long long;
const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};
const double PI = 3.1415926535;
const ll inf = 1001001001;
const ll e9 = 1000000000;
const ll mod = 1000000007;
int main() {
  int n;
  cin >> n;
  queue<string> que;
  que.push("a");
  int p = 2;
  for (int i = 2; i < n + 1; ++i) {
    for (int j = 1; j < p; ++j) {
      string s = que.front();
      que.pop();
      int i2 = s[s.size() - 1] - 'a';
      for (int k = 0; k < i2 + 2; ++k) {
        char temp = k + 'a';
        que.push(s + temp);
      }
    }
    p = que.size() + 1;
  }
  while (!que.empty()) {
    cout << que.front() << endl;
    que.pop();
  }
  return 0;
}
