#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e17 + 9;
int n;
vector<string> ss;
void solve(int falt, string s) {
  if (falt == 0) {
    ss.push_back(s);
    return;
  }
  for (int i = 0; i <= n - falt; i++) {
    solve(falt - 1, s + char(i + 'a'));
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  if (n == 1) {
    cout << "a" << endl;
    return 0;
  }
  solve(n - 1, "a");
  sort(begin(ss), end(ss));
  for (int i = 0; i < ((int)(ss).size()); ++i) cout << ss[i] << '\n';
  return 0;
}
