#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int nx[4] = {0, -1, 0, 1};
int ny[4] = {-1, 0, 1, 0};
ll gcd(ll a, ll b) {
  if (b > a) swap(a, b);
  ll r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int n;
void dfs(string s, char mx) {
  if (s.size() == n) {
    cout << s << endl;
    return;
  }
  for (char c = 'a'; c <= mx + 1; c++) {
    string t = s;
    t += c;
    dfs(t, c);
  }
}
int main() {
  cin >> n;
  dfs("", 'a' - 1);
  return 0;
}
