#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int mod = 1000000007;
int n;
vector<string> G;
char s[12];
void Dfs(int p, int tot) {
  if (p > n) {
    cout << s + 1 << '\n';
    return;
  }
  for (int i = 1; i <= tot; ++i) {
    s[p] = s[i];
    Dfs(p + 1, tot);
  }
  s[p] = 'a' + tot;
  Dfs(p + 1, tot + 1);
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  s[n + 1] = '\0';
  Dfs(1, 0);
  return 0;
}
