#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  n--;
  set<string> s;
  s.insert("a");
  char c = 'b';
  while (n--) {
    set<string> ms;
    for (auto i : s) {
      string temp = i;
      temp.push_back('a');
      ms.insert(temp);
      temp = "a";
      temp += i;
      ms.insert(temp);
    }
    string temp = *(--s.end());
    temp.push_back(c);
    ms.insert(temp);
    s = ms;
    c++;
  }
  for (auto i : s) cout << i << "\n";
}
