let pow x n = let rec doit x n acc = if n = 0 then acc else doit (x * x) (n / 2) (if n mod 2 = 0 then acc else acc * x) in doit x n 1 let print_lst l = List.iteri (fun i e -> Printf.printf (if i = 0 then "%d" else " %d") e) l; print_newline () let () = let k = read_int () in let n = pow 2 k - 1 in let l = [3; 2; 1] in if k = 2 then print_lst l else let rec doit i l = let l = i - 2 :: l @ [i - 3; i - 1; i] in if i = n then l else doit (i + 4) l in doit 7 l |> print_lst