Scanf.scanf "%d" @@ fun n ->
  let p = Array.make n 0 in
  for i = 1 to n do Scanf.scanf " %d" (fun x -> p.(x-1) <- i) done;
  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 ();
