#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
set<string> ans;
int n;
void dfs(string s) {
  if (s.size() == n) {
    cout << s << endl;
    return;
  }
  int k = s.back() - 'a';
  for (int i = 0; i <= k + 1; i++) {
    string t = s;
    t.push_back('a' + i);
    dfs(t);
  }
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cin >> n;
  dfs("a");
  for (auto x : ans) cout << x << endl;
  return 0;
}
