#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
vector<vector<string>> l(11);
void solve(int now, string s) {
  l[now].push_back(s);
  if (now == 10) {
    return;
  }
  for (char c = 'a'; c != s[now - 1] + 2; c++) {
    solve(now + 1, s + c);
  }
  return;
}
int main() {
  int n;
  cin >> n;
  string s = "a";
  solve(1, s);
  sort(l[n].begin(), l[n].end(), less<string>());
  for (long long i = 0; i < (l[n].size()); i++) {
    cout << l[n][i] << endl;
  }
  return 0;
}
