#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long long int INF = (long long int)1e15;
vector<string> v;
long long int N;
void dfs(string s) {
  if (s.length() == N) {
    v.push_back(s);
    return;
  }
  char c = (char)(s[s.length() - 1] + 1);
  s.push_back(c);
  dfs(s);
  s.pop_back();
  long long int n = s.length();
  for (long long int i = n - 1; i >= 0; --i) {
    char d = s[i];
    s.push_back(d);
    dfs(s);
    s.pop_back();
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  string s = "a";
  dfs(s);
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  for (long long int(i) = (0); (i) < (v.size()); ++(i)) {
    cout << v[i] << endl;
  }
  return 0;
}
