#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  return b ? gcd(b, a % b) : a;
}
unsigned long long lcm(unsigned long long a, unsigned long long b) {
  return a / gcd(a, b) * b;
}
int n;
void dfs(string s, char mx) {
  if (int(s.length()) == n) {
    cout << s.c_str() << endl;
    return;
  }
  for (char c = 'a'; c <= mx; c++) {
    dfs(s + c, c == mx ? c + 1 : c);
  }
}
int main() {
  cin >> n;
  dfs("", 'a');
  return 0;
}
