#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = (1 << 30) - 1;
const ll LINF = (1L << 62) - 1;
const ll MOD = 1000000007;
template <class T>
inline void chmin(T& a, T& x) {
  a = a < x ? a : x;
}
template <class T>
inline void chmax(T& a, T& x) {
  a = a > x ? a : x;
}
int n;
vector<string> ans;
void make(int k, string s) {
  if (k == n) {
    ans.push_back(s);
    return;
  } else {
    for (int i = 0; i < k + 1; ++i) {
      char c = (int)'a' + i;
      string t = s;
      t.push_back(c);
      make(k + 1, t);
    }
    return;
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  string s = "a";
  make(1, s);
  sort((ans).begin(), (ans).end());
  for (string t : ans) {
    cout << t << endl;
  }
  return 0;
}
