#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 100100100100;
const long long MOD = 1000000007;
long long mod_pow(long long N, long long M) {
  if (M == 0) return 1;
  long long res = mod_pow((N * N) % MOD, M / 2);
  if (M & 1) res = (res * N) % MOD;
  return res %= MOD;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
vector<string> ans;
void dfs(int Size, string now) {
  if (now.size() == Size) {
    ans.push_back(now);
    return;
  } else {
    now.push_back(now.back());
    while (now.back() - 97 < Size) {
      dfs(Size, now);
      now.back()++;
    }
  }
}
int main() {
  int N;
  cin >> N;
  string S = "a";
  dfs(N, S);
  for (string OUTPUT : ans) cout << OUTPUT << endl;
}
