#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
using namespace std;
long long int n;
vector<char> v;
vector<string> ans;
void fun() {
  if (v.size() == n) {
    string temp = "";
    for (int i = 0; i < n; i++) temp += v[i];
    ans.push_back(temp);
    return;
  } else {
    for (int i = 0; i < v.size(); i++) {
      char p = v[i];
      v.push_back(p);
      fun();
      v.pop_back();
      p++;
      v.push_back(p);
      fun();
      v.pop_back();
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  v.push_back('a');
  fun();
  sort(ans.begin(), ans.end());
  vector<string> a2;
  for (int i = 0; i < ans.size(); i++) {
    if (i == 0)
      a2.push_back(ans[i]);
    else {
      if (a2[a2.size() - 1] != ans[i]) a2.push_back(ans[i]);
    }
  }
  for (int i = 0; i < a2.size(); i++) cout << a2[i] << "\n";
  return 0;
}
