#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long long int INF = (long long int)1e15;
long long int N;
vector<string> ans;
void dfs(string s, char nxt) {
  if (s.length() == N) {
    ans.push_back(s);
    return;
  }
  for (char c = 'a'; c <= nxt; ++c) {
    s.push_back(c);
    dfs(s, c + 1);
    s.pop_back();
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  ans.clear();
  dfs("", 'a');
  sort(ans.begin(), ans.end());
  ans.erase(unique(ans.begin(), ans.end()), ans.end());
  for (long long int(i) = (0); (i) < (ans.size()); ++(i)) {
    cout << ans[i] << endl;
  }
  return 0;
}
