Scanf.(Array.(scanf" %d"@@fun n ->
	let p = init n (fun _->scanf" %d"@@fun v->v) in
	let c = make n 0 in
	iteri (fun i v -> c.(v-1) <- i+1) p;
	iteri (fun i _ -> 
		Printf.printf "%d " (20005*(i+1));
	) p; print_newline ();
	iteri (fun i _ -> 
		Printf.printf "%d " (20005*(n-(i+1))+p.(i));
	) p; print_newline ()));;