#include <bits/stdc++.h>
using namespace std;
void print() { cout << endl; }
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(tail) != 0) cout << " ";
  print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T>& vec) {
  for (auto& a : vec) {
    cout << a;
    if (&a != &vec.back()) cout << " ";
  }
  cout << endl;
}
template <class T>
void print(vector<vector<T>>& df) {
  for (auto& vec : df) {
    print(vec);
  }
}
const int INF = 1e9;
const int MOD = 1e9 + 7;
vector<vector<int>> ans;
int n;
void f(string s, int k) {
  if (k == n) {
    cout << s << endl;
    return;
  }
  set<char> st;
  char max_c;
  for (const char c : s) {
    if (c > max_c) max_c = c;
    st.insert(c);
  }
  for (const auto c : st) {
    f(s + char(c), k + 1);
  }
  f(s + char(max_c + 1), k + 1);
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  f("a", 1);
}
