#include <bits/stdc++.h>
using namespace std;
long long inf = 1000000000000;
long long mod = 1000000007;
vector<string> vs;
void stringy(string s, const long long n, long long k) {
  if (k == n) {
    vs.push_back(s);
  } else {
    for (long long i = 0; i <= k; ++i) {
      s[k] = (char)('a' + i);
      stringy(s, n, k + 1);
    }
  }
}
int main() {
  long long n;
  cin >> n;
  string s(n, ' ');
  stringy(s, n, 0);
  for (auto e : vs) {
    cout << e << "\n";
  }
}
