#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline int chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline int chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const int INF = 1 << 30;
const ll LINF = 1LL << 58;
const int mod = 1000000007;
int n;
void dfs(string s) {
  if (s.size() == n) {
    cout << s << endl;
    return;
  }
  for (char c = 'a'; c <= s.back() + 1; c++) {
    dfs(s + c);
  }
  return;
}
int main() {
  cin >> n;
  dfs("a");
  return 0;
}
