Scanf.scanf "%d" (fun n ->
    let r = Array.make n 0 in
    for i = 1 to n do
        Scanf.scanf " %d" (fun p -> r.(p - 1) <- i)
    done;
    for i = 1 to n do
        Printf.printf "%d " (i * 25000)
    done;
    print_newline ();
    for i = 1 to n do
        Printf.printf "%d " ((n + 1 - i) * 25000 + r.(i - 1))
    done;
    print_newline ();
)