#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const vector<int> di = {-1, 0, 1, 0};
const vector<int> dj = {0, 1, 0, -1};
bool check(string a, string b) {
  bool taka = true;
  for (int i = 0; i < a.size(); i++) {
    char c = a.at(i);
    for (int j = 0; j < a.size() - i; j++) {
      if (a.at(i) == a.at(j + 1)) {
        if (b.at(i) != b.at(j + 1)) {
          taka = false;
          break;
        }
      }
      if (a.at(i) != a.at(j + 1)) {
        if (b.at(i) == b.at(j + 1)) {
          taka = false;
          break;
        }
      }
    }
    if (taka == false) break;
  }
  return taka;
}
int main() {
  int n;
  cin >> n;
  int num = 1 + ((n - 1) * n) / 2;
  int len = pow(2, n);
  vector<string> c(len);
  vector<vector<int>> m(num);
  for (int tmp = 0; tmp < (1 << n); tmp++) {
    bitset<10> s(tmp);
    int cnt = 1;
    for (int i = 0; i < n; i++) {
      if (s.test(i)) {
        c.at(tmp) += 'a' + cnt;
        cnt++;
      } else {
        c.at(tmp) += 'a';
      }
    }
  }
  sort(c.begin(), c.end());
  for (int i = 0; i < num; i++) {
    string test = c.at(i);
    if (i == 0) {
      cout << c.at(i) << endl;
      continue;
    }
    for (int j = 0; j < i; j++) {
      bool che = check(test, c.at(j));
      if (che == false) {
        if (j == (i - 1)) {
          cout << test << endl;
        }
        continue;
      } else {
        break;
      }
    }
  }
  return 0;
}
