#include <bits/stdc++.h>
using namespace std;
long long mod(long long a) {
  long long c = a % (long long)(1E9 + 7);
  if (c >= 0) return c;
  return c + (long long)(1E9 + 7);
}
long long inf = (long long)1E16;
long long max(long long a, long long b) {
  if (a < b)
    return b;
  else
    return a;
}
long long min(long long a, long long b) {
  if (a > b)
    return b;
  else
    return a;
}
void Max(long long &pos, long long val) { pos = max(pos, val); }
void Min(long long &pos, long long val) { pos = min(pos, val); }
void Add(long long &pos, long long val) { pos = mod(pos + val); }
long double EPS = 1E-9;
void yes() {
  cout << "Yes"
       << "\n";
}
void no() {
  cout << "No"
       << "\n";
}
vector<string> ans;
long long n;
void dfs(string s, long long k) {
  if (k == n) {
    ans.push_back(s);
    return;
  }
  for (long long i = 0; i <= k; i++) {
    char ad = (char)('a' + i);
    dfs(s + ad, k + 1);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  dfs("", 0);
  sort(ans.begin(), ans.end());
  for (auto x : ans) {
    cout << x << "\n";
  }
  return 0;
}
