#include <bits/stdc++.h>
using namespace std;
int n;
vector<string> ans;
void make(string t, int cnt) {
  if (cnt == n) {
    ans.push_back(t);
    return;
  }
  make(t + (char)(t.back()), cnt + 1);
  make(t + (char)(t.back() + 1), cnt + 1);
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cin >> n;
  vector<string> s;
  make("a", 1);
  for (string p : ans) {
    cout << p << endl;
  }
}
