Scanf.scanf "%d" @@ fun n ->
  let p = Array.init n (fun _ -> Scanf.scanf " %d" pred) in
  Array.init n (fun i -> (n+1) * i + p.(i)) |> Array.iter (Printf.printf "%d "); print_newline ();
  Array.init n (fun i -> (n+1) * (n-i)) |> Array.iter (Printf.printf "%d "); print_newline ();