#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using v1 = vector<int>;
using vl = vector<long long>;
using v2 = vector<vector<int>>;
using v3 = vector<vector<char>>;
int N;
void stringEq(vector<char> a, char max) {
  if (a.size() == N) {
    for (int i = 0; i < (N); ++i) {
      cout << a.at(i);
    }
    cout << endl;
    return;
  }
  int t = max - 97 + 2;
  for (int i = 0; i < (t); ++i) {
    char b = 97 + i;
    vector<char> c = a;
    c.push_back(b);
    stringEq(c, b);
  }
}
int main() {
  cin >> N;
  vector<char> a(0);
  char c = 'a';
  a.push_back(c);
  stringEq(a, c);
}
