#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double pi = 3.14159265358979323846;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
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;
}
set<string> ans;
int n;
int rec(string s, char c) {
  if (s.size() == n) {
    ans.insert(s);
    return 0;
  }
  int k = c - 'a';
  k++;
  for (int i = 0; i <= k; i++) {
    char d = (char)('a' + i);
    s += d;
    rec(s, d);
    s.pop_back();
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  string s = "";
  s += 'a';
  rec(s, 'a');
  for (auto& v : ans) {
    cout << v << endl;
  }
  return 0;
}
