#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
vector<int> v;
int n;
void dfs(int x, int pre) {
  if (x == n) {
    for (auto it : v) cout << char('a' + it);
    cout << '\n';
    return;
  }
  for (int i = 0; i <= pre; i++) {
    v.push_back(i);
    dfs(x + 1, i + 1);
    v.pop_back();
  }
}
int main() {
  std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  dfs(0, 0);
  return 0;
}
