#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using Graph = vector<vi>;
using P = pair<int, int>;
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const ll LINF = (ll)1e18;
int main() {
  int n;
  cin >> n;
  string ret = string(n, 'a');
  vector<string> se;
  vector<bool> che(2000);
  for (int i = 0; i < (1 << n); i++) {
    bitset<10> bit(i);
    string tmp = ret;
    for (int j = 0; j < (int)(n); j++) {
      if (bit.test(j)) {
        tmp[j]++;
      }
    }
    se.push_back(tmp);
  }
  if (n == 3) se.push_back("abc");
  sort(se.begin(), se.end());
  for (auto t : se) {
    if (t[0] == 'b') continue;
    cout << t << endl;
  }
}
