#include <bits/stdc++.h>
using namespace std;
const long long MOD = (1e+9) + 7;
const long long INF = 2e+9 + 10;
int facctorialMethod(int k) {
  int sum = 1;
  for (int i = 1; i <= k; ++i) {
    sum *= i;
  }
  return sum;
}
class Radix {
 private:
  const char* s;
  int a[128];

 public:
  Radix(const char* s = "0123456789ABCDEF") : s(s) {
    int i;
    for (i = 0; s[i]; ++i) a[(int)s[i]] = i;
  }
  std::string to(long long p, int q) {
    int i;
    if (!p) return "0";
    char t[64] = {};
    for (i = 62; p; --i) {
      t[i] = s[p % q];
      p /= q;
    }
    return std::string(t + i + 1);
  }
  std::string to(const std::string& t, int p, int q) { return to(to(t, p), q); }
  long long to(const std::string& t, int p) {
    int i;
    long long sm = a[(int)t[0]];
    for (i = 1; i < (int)t.length(); ++i) sm = sm * p + a[(int)t[i]];
    return sm;
  }
};
int func(int N) {
  int res = 0;
  while (--N) res += N;
  return res;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<vector<bool>> mt;
  vector<long long> v(N);
  vector<long long> v2(N);
  for (int i = 0; i < N; i++) v2[i] = i;
  vector<vector<long long>> res;
  Radix r;
  int val = 0;
  while (v != v2) {
    string s = r.to(val, N);
    istringstream ss = istringstream(s);
    int num = atoi(s.c_str());
    ss >> num;
    for (int j = 0; j < N; j++) {
      v[j] = num % 10;
      num /= 10;
    }
    reverse(v.begin(), v.end());
    vector<bool> vc;
    for (int i = 0; i < N; i++) {
      for (int j = i + 1; j < N; j++) {
        vc.push_back(v[i] == v[j]);
      }
    }
    bool flg = find(mt.begin(), mt.end(), vc) != mt.end();
    if (flg) {
      res.push_back(v);
    }
    val++;
  }
  for (int i = 0; i < res.size(); i++) {
    for (int j = 0; j < res[i].size(); j++) {
      cout << (char)res[i][j] + 'a';
    }
    cout << "\n";
  }
  return 0;
}
