#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
char al[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
vector<string> res;
int N;
void recv(string s, int types, int depth, bool l) {
  if (depth > N) {
    res.push_back(s);
    return;
  }
  for (int i = (int)(0); i < (int)(types - 1); ++i) {
    recv(s + al[i], types, depth + 1, false);
  }
  recv(s + al[types - 1], types + 1, depth + 1, true);
  recv(s + al[types - 1], types, depth + 1, false);
}
int main() {
  cin >> N;
  if (N == 1)
    cout << "a" << endl;
  else {
    recv("a", 2, 2, true);
  }
  sort(res.begin(), res.end());
  for (auto x : res) cout << x << endl;
}
