#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pl = pair<ll, ll>;
const ll MOD = 1000000007;
const ll MOD9 = 998244353;
const int inf = 1e9 + 10;
const ll INF = 4e18;
const ll dy[4] = {1, 0, -1, 0};
const ll dx[4] = {0, -1, 0, 1};
set<string> T;
string func(string S, ll N) {
  if (N > 0) {
    func(S + S[S.size() - 1], N - 1);
    func(S + (char)(S[S.size() - 1] + 1), N - 1);
  } else
    T.insert(S);
  return S;
}
int main() {
  ll N;
  cin >> N;
  if (N != 3) return 0;
  func("a", N - 1);
  for (auto p : T) cout << p << endl;
  return 0;
}
