#include<bits/stdc++.h>
//#include"Templates/libraries.h"
using namespace std;

void dfs(string str, int n){
  if(str.length()==n){
    cout << str << '\n';
  }else{
    rep0(i,(int)(str.back()-'a'+2)){
      dfs(str+(char)('a'+i), n);
    }
  }

}
int main(){
  int n;
  cin >> n;

  dfs("a",n);
}
  