#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = double;
const ll MODBASE = 1000000007LL;
const int MAXN = 110;
const int MAXM = 1000;
const int MAXK = 16;
const int MAXQ = 200010;
int n;
char a[10];
void solve(int u) {
  if (u == n) {
    for (int i = (0); i <= (n - 1); i++) cout << a[i];
    cout << "\n";
    return;
  }
  for (int i = (0); i <= (u); i++) {
    a[u] = char(i + 'a');
    solve(u + 1);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  cin >> n;
  solve(0);
  return 0;
}
