#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
int n;
vector<string> ans;
set<string> ok;
string yorn(bool a) {
  if (a) return "Yes";
  return "No";
}
string YorN(bool a) {
  if (a) return "YES";
  return "NO";
}
ll gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void mysort(vector<string> &a) { sort(a.begin(), a.end()); }
void solve(string s) {
  if (s.size() == n) {
    if (!ok.count(s)) {
      ok.insert(s);
      ans.push_back(s);
    }
  } else {
    string a, b, c;
    a = s + "a";
    b = s + s.at(s.size() - 1);
    c = s;
    char d = s.at(s.size() - 1);
    c += (char)(d + 1);
    solve(a);
    solve(b);
    solve(c);
  }
}
int main() {
  cin >> n;
  if (n == 1) {
    cout << 'a' << endl;
    return 0;
  } else if (n == 2) {
    cout << "aa" << endl;
    cout << "ab" << endl;
    return 0;
  }
  solve("a");
  mysort(ans);
  for (auto i : ans) cout << i << endl;
}
