#include <bits/stdc++.h>
using namespace std;
int dbg = 0;
const int N = 2e5 + 1;
const int lg = 20;
const long long mod = 0xfffff;
int n;
string alph = "abcdefghij";
vector<string> ans;
void dfs(int i, string& s) {
  if (i == n) {
    ans.push_back(s);
    return;
  }
  for (int j = 0; j < i + 1; j++) {
    string t = s + alph[j];
    dfs(i + 1, t);
  }
}
void solve() {
  cin >> n;
  string base = "a";
  dfs(1, base);
  for (int i = 0; i < ((int)(ans).size()); i++) cout << ans[i] << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
