#include <bits/stdc++.h>
using namespace std;
int popcount(int n) {
  int c = 0;
  for (int i = 0; i < 10; i++) {
    if (n & (i + 1)) c++;
  }
  return c;
}
vector<string> ans;
void select(char c, int bits, char s[10], int n) {
  int nc = popcount(bits);
  for (int i = (1 << n) - 1; 0 <= i; i--) {
    int k = i;
    bool is_ok = true;
    for (int j = 0; j < n; j++) {
      if (!(bits & (1 << j)) && (k & (1 << j))) {
        is_ok = false;
        break;
      }
    }
    if (!is_ok) continue;
    for (int j = 0; j < n; j++) {
      if (k & (1 << j)) {
        s[(n - 1 - j)] = c;
      }
    }
    int cc = popcount(k);
    if (nc == cc) {
      ans.push_back(s);
      continue;
    }
    char d = c + 1;
    int nbits = bits - k;
    for (int j = n; 0 <= j; j--) {
      if (nbits & (1 << j)) {
        s[n - 1 - j] = d;
        nbits -= (1 << j);
        break;
      }
    }
    select(d, nbits, s, n);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed << setprecision(20);
  int n;
  cin >> n;
  int bits = (1 << n) - 1;
  if (n == 1) {
    cout << "a" << endl;
    return 0;
  }
  char s[11] = {0};
  s[0] = 'a';
  bits -= (1 << (n - 1));
  select('a', bits, s, n);
  sort(ans.begin(), ans.end());
  for (auto& a : ans) {
    cout << a << endl;
  }
  return 0;
}
