#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
set<string> ans;
int n;
int a[10];
string s;
void dfs(int d) {
  if (d == n) {
    for (int i = 0, c = 'a', b = 0; i < n; ++i) {
      if (a[i]) {
        if (b == 0) b = c;
        s[i] = b;
      } else {
        s[i] = c++;
      }
    }
    ans.insert(s);
    return;
  }
  dfs(d + 1);
  a[d] = 1;
  dfs(d + 1);
  a[d] = 0;
}
int main() {
  cin >> n;
  s = string(n, 'a');
  dfs(0);
  for (auto t : ans) {
    cout << t << endl;
  }
  return 0;
}
