#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
vector<char> v;
void p() {
  for (char c : v) {
    cout << c;
  }
  cout << endl;
}
void dfs(int digits, int idx) {
  if (digits == idx) {
    p();
    return;
  } else {
    for (int i = 0; i < idx + 1; i++) {
      v[idx] = 'a' + i;
      dfs(digits, idx + 1);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  v.resize(n);
  dfs(n, 0);
  return 0;
}
