#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long c = gcd(a, b);
  return ((a / c) * (b / c) * c);
}
const long long INF = long long(1e16) + long long(7);
const long long MOD = 1000000007LL;
long long keta(long long a) {
  long long r = 0;
  while (a) {
    a /= 10;
    r++;
  }
  return r;
}
long long ketawa(long long a) {
  long long r = 0;
  while (a) {
    r += a % 10;
    a /= 10;
  }
  return r;
}
int main() {
  int n;
  cin >> n;
  vector<string> ans, t, cls;
  ans.push_back("a");
  if (n == 1) {
    cout << "a" << endl;
    return 0;
  }
  for (long long i = long long(0); i < long long(n - 1); ++i) {
    for (auto s : ans) {
      t.push_back(s + "a");
      t.push_back(s + "b");
    }
    ans = t;
    t = cls;
  }
  (sort(ans.begin(), ans.end()));
  for (auto s : ans) {
    cout << s << endl;
  }
}
