#include <bits/stdc++.h>
using namespace std;
vector<bool> prime(100 + 1, true);
void prime_table(void) {
  prime[0] = false;
  prime[1] = false;
  for (long long i = 2; i * i <= 100; i++) {
    if (!prime[i]) {
      continue;
    }
    for (long long j = i + i; j <= 100; j += j + i) {
      prime[j] = false;
    }
  }
}
bool IsPrime(long long num) {
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false;
  double sqrtNum = sqrt(num);
  for (long long i = 3; i <= sqrtNum; i += 2) {
    if (num % i == 0) {
      return false;
    }
  }
  return true;
}
vector<long long> divisor(long long n) {
  vector<long long> ret;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i - 1);
      if (i * i != n) {
        ret.push_back((n / i) - 1);
      }
    }
  }
  sort(ret.begin(), ret.end());
  return (ret);
}
long long a, b;
void f(long long x) {
  a = x % 10;
  b = 0;
  while (x) {
    b = x;
    x /= 10;
  }
}
signed main() {
  long long N;
  cin >> N;
  queue<string> que;
  que.push("a");
  while (!que.empty()) {
    string s = que.front();
    que.pop();
    if (s.size() == N) {
      cout << s << endl;
    } else {
      for (long long i = (0); i < (s[s.length() - 1] - 'a' + 2); i++) {
        char plus = (char)('a' + i);
        que.push(s + plus);
      }
    }
  }
}
