#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios::sync_with_stdio(0);
  cin.tie(0);
}
int n, v[15], freq[30];
set<string> s;
void afisare() {
  string sol = "";
  int nr = 0;
  for (int i = 1; i <= n; i++) {
    if (!freq[v[i]]) {
      nr++;
      freq[v[i]] = nr;
    }
    sol += char(96 + freq[v[i]]);
  }
  s.insert(sol);
  for (int i = 1; i <= 26; i++) freq[i] = 0;
}
void bkt(int k) {
  for (int i = v[k - 1]; i <= n; i++) {
    v[k] = i;
    if (k == n)
      afisare();
    else
      bkt(k + 1);
  }
}
int main() {
  fast();
  cin >> n;
  v[0] = 1;
  bkt(1);
  for (auto it : s) cout << it << "\n";
  return 0;
}
