import std.stdio, std.conv, std.string, std.algorithm, std.math, std.array, std.container;

int n;

void solve(int max_i, string prefix) {
  if(prefix.length == n) {
    writeln(prefix);
    return;
  }
  for(int i=0; i<max_i+1; i++) solve(max(i+1, max_i), prefix~('a'+i).to!char);
}

void main() {
  n = readln.chomp.to!int;
  solve(0, "");
}

