#include <bits/stdc++.h>
using namespace std;
long long p = 1000000007;
long long const N = 1e6 + 5;
void rec(int n, vector<string>& ans, string temp, int i, char c) {
  if (i == n) {
    ans.push_back(temp);
    return;
  }
  for (char d = 'a'; d <= c; d++) {
    temp[i] = d;
    rec(n, ans, temp, i + 1, d + 1);
  }
  return;
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  int T = 1;
  while (T--) {
    int n;
    cin >> n;
    vector<string> ans;
    string temp;
    for (long long i = 0; i < (n); ++i) temp.push_back('a');
    rec(n, ans, temp, 1, 'b');
    sort(ans.begin(), ans.end());
    for (long long i = 0; i < ((int)(ans).size()); ++i) {
      cout << ans[i] << '\n';
    }
  }
  return 0;
}
