#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = 1ll << 60;
int dx[4]{0, 1, 0, -1};
int dy[4]{1, 0, -1, 0};
vector<string> S;
ll N;
void f(string s, ll cnt) {
  if (cnt == N) {
    S.push_back(s);
    return;
  }
  for (char c = 'a'; c <= char(s.back() + 1); ++c) {
    f(s + c, cnt + 1);
  }
}
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> N;
  f("a", 1);
  for (auto &e : S) std::cout << e << std::endl;
  return 0;
}
