#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll mod = 1000000007;
constexpr int inf = 1000000000;
constexpr ll linf = 1000000000000000000;
int n;
vector<string> ans;
void solve(int i, string s) {
  if (i == n) {
    ans.push_back(s);
    return;
  }
  s[i] = s[i - 1];
  solve(i + 1, s);
  s[i] = s[i - 1] + 1;
  solve(i + 1, s);
}
int main() {
  cin >> n;
  string s = {};
  for (int i = 0; i < n; ++i) s += 'a';
  solve(1, s);
  for (auto str : ans) {
    cout << str << endl;
  }
}
