#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Int = long long;
const int MOD = 1000000007;
const ll INF = numeric_limits<ll>::max();
const int inf = 1e8;
string t = "";
vector<string> s;
void hoge(int n) {
  for (int(i) = (n); (i) < (int)(t.size()); (i)++) {
    t[i] = t[i] + 1;
    s.push_back(t);
  }
  return;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int(i) = 0; (i) < (int)(n); (i)++) t = t + 'a';
  s.push_back(t);
  for (int(i) = (1); (i) < (int)(n); (i)++) {
    hoge(i);
  }
  sort(s.begin(), s.end());
  for (int(i) = 0; (i) < (int)(s.size()); (i)++) cout << s[i] << endl;
}
