#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(int (i) = 0; (i) < (N); (i)++)
#define all(v) (v).begin(), (v).end()
#define eb emplace_back

int main(){
  int N;
  cin >> N;
  vector<string> ans;
  
  auto dfs = [&](auto&& dfs_, string S, int p) -> void {
    if(S.size() == N) {
      ans.emplace_back(S);
      return;
    }
    
    for(char c = 'a'; c != 'a'+p+1; c++){
      string T = S;
      T.push_back(c);
      dfs_(dfs_, T, p+1);
    }
    return;
  };
  
  dfs(dfs, "a", 1);
  string s = "";
  rep(i, N-1) s += "a";
  if(N > 2) s.push_back('a' + N-1);
  sort(all(ans));
  for(auto& c : ans){
    if(c == s) continue;
    cout << c << endl;
  }
}
