#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int n;
vector<string> ans;
void dfs(string res, int p) {
  if (res.size() == n) {
    ans.push_back(res);
    return;
  }
  for (int i = (int)(0); i < (int)(p); ++i) {
    char c = 'a' + i;
    dfs(res + c, p + 1);
  }
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  dfs("a", 2);
  sort(ans.begin(), ans.end());
  ;
  for (int i = (int)(0); i < (int)(ans.size()); ++i) {
    cout << ans[i] << endl;
  }
}
