#include <bits/stdc++.h>
using namespace std;
vector<string> ans;
bool check(string s, int n) {
  if (ans.size() == 0) return true;
  for (auto all : ans) {
    int flag = 0;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        if (s[i] == s[j] && all[i] == all[j]) continue;
        if (s[i] != s[j] && all[i] != all[j]) continue;
        flag = 1;
        break;
      }
      if (flag == 1) break;
    }
    if (flag == 0) return false;
  }
  return true;
}
void sol(vector<char> v, int val, vector<string> vc, int n) {
  if (val == n || v.size() == n) {
    string s;
    for (auto all : v) s += all;
    if (check(s, n)) ans.push_back(s);
    return;
  }
  for (char c : vc[val]) {
    v.push_back(c);
    sol(v, val + 1, vc, n);
    v.pop_back();
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<string> vc;
  for (int i = 0; i < n; i++) {
    string s;
    char c = 'a';
    for (int j = 0; j <= i; j++) s += c, c++;
    vc.push_back(s);
  }
  vector<char> v;
  sol(v, 0, vc, n);
  for (auto all : ans) cout << all << endl;
}
