#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;
vector<char> s;
void f(int v, int w) {
  for (int i = (0); i < (v); ++i) {
    s[v - 1] = 'a' + i;
    if (v == w) {
      for (int j = (0); j < (w); ++j) cout << s[j];
      cout << endl;
    } else {
      f(v + 1, w);
    }
  }
}
int main() {
  int n;
  cin >> n;
  s.resize(n);
  f(1, n);
  return 0;
}
