#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const double PI = acos(-1);
int n;
vector<string> ans;
void dfs(string s, char use, long long len = 0) {
  if (n == len) {
    ans.push_back(s);
    return;
  }
  for (char i = 'a'; i <= use; i++) {
    string ns = s + i;
    dfs(ns, i + 1, len + 1);
  }
}
int main() {
  cin >> n;
  long long res = 0;
  dfs("", 'a');
  sort(ans.begin(), ans.end());
  for (auto x : ans) cout << x << endl;
}
