let alphabet = "abcdefghijklmnopqrstuvwxyz"
let () =
  Scanf.scanf "%d" @@ fun n ->
  for b = 0 to (1 lsl (n-1)) - 1 do
    let d = Array.init (n-1) (fun i -> (b lsr (n-2-i)) land 1) in
    let c = Array.make n 0 in
    for i = 1 to n-1 do
      c.(i) <- c.(i-1) + d.(i-1);
    done;
    Array.iter (fun v -> Printf.printf "%c" alphabet.[v]) c;
    print_newline ();
  done;
