#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 1000000007;
const long long INFLL = 1000000000000000007LL;
void dfs(string s, char i, int n) {
  if (n == s.size()) {
    cout << s << endl;
    return;
  }
  for (char c = 'a'; c <= i + 1; c++) {
    dfs(s + c, c, n);
  }
}
void solve() {
  int N;
  cin >> N;
  dfs("a", 'a', N);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}
