#include <bits/stdc++.h>
using namespace std;
int n;
vector<string> v;
string s;
bool check(string u, string v) {
  for (int i = 0; i < n - 1; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (u[i] != u[j]) {
        if (v[i] == v[j]) return false;
      }
      if (u[i] == u[j]) {
        if (v[i] != v[j]) return false;
      }
    }
  }
  return true;
}
void process(int i, int ma) {
  if (i == n + 1) {
    if (v.empty() || !check(v.back(), s)) v.push_back(s);
    return;
  }
  for (int j = 0; j <= ma; ++j) {
    s[i - 1] = ('a' + j);
    process(i + 1, ma + 1);
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) s += '.';
  process(1, 0);
  for (auto i : v) cout << i << "\n";
  return 0;
}
