#include <bits/stdc++.h>
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
using P = pair<int, int>;
using ll = long long;
const ll INF = 1LL << 60;
const double PI = 3.1415926535897932;
const int MOD = 1e9 + 7;
int n;
set<string> ans;
void dfs(string str, char ch) {
  if (str.size() == n) {
    ans.insert(str);
    return;
  }
  dfs(str + ch, ch);
  dfs(str + ch, ch + 1);
}
int main() {
  cin >> n;
  dfs("", 'a');
  for (auto v : ans) {
    cout << v << endl;
  }
  return 0;
}
