#include <bits/stdc++.h>
using namespace std;
struct edge {
  int to;
  int weight;
  edge(int t, int w) : to(t), weight(w) {}
};
using Graph = vector<vector<int>>;
using dou = long double;
string Yes = "Yes";
string YES = "YES";
string NO = "NO";
string No = "No";
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const int INF = 2000000000;
const long long INF64 = 922337203685477580ll;
const int mod = 1000000007ll;
const long long MOD = 1000000007LL;
const double pi = 3.1415926535897932384626;
class Radix {
 private:
  const char* s;
  int a[100000];

 public:
  Radix(const char* s = "abcdefghijklmnopqrstu") : 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 "a";
    char t[64000] = {};
    for (i = 62000; 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 main() {
  Radix r;
  int n;
  std::cin >> n;
  long long m = 0;
  for (int i = 0; i < (int)(n - 1); i++) {
    m += pow(n, i) * (n - i - 1);
  }
  for (int i = 0; i < (int)(m + 1); i++) {
    string s = r.to(i, n);
    std::set<int> second;
    second.insert('a');
    int c = 0;
    for (int i = 0; i < (int)(s.size()); i++) {
      second.insert(s[i]);
      c = max(s[i] - 'a', c);
    }
    if (c < second.size())
      std::cout << std::setfill('a') << std::right << std::setw(n) << s
                << std::endl;
  }
}
