let n = Scanf.sscanf (read_line ()) "%d" @@ fun n -> n

let next arr =
  let last = Array.length arr - 1 in
  arr.(last) <- arr.(last) + 1;
  for i = last downto 1 do
    if arr.(i) = 2 then begin
      arr.(i - 1) <- arr.(i - 1) + 1;
      arr.(i) <- 0
    end
  done

let rec loop arr =
  if arr.(0) = 0 then begin
    Array.iter (fun i -> print_string @@ if i = 0 then "a" else "b") arr;
    print_newline ();
    next arr;
    loop arr
  end

let () = loop @@ Array.make n 0