let rec solve route left right sum l as_ =
  if right <= left then Some (List.rev route)
  else if sum < l then None
  else if as_.(left) <= as_.(right) then solve (left + 1 :: route) (left + 1) right (sum - as_.(left)) l as_
  else solve (right :: route) left (right - 1) (sum - as_.(right)) l as_
let solve l as_ = solve [] 0 (Array.length as_ - 1) (Array.fold_left ( + ) 0 as_) l as_

let () =
  let n, l = Scanf.scanf "%d %d\n" (fun n l -> n, l) in
  let as_ = Array.init n (fun _ -> Scanf.scanf "%d " (fun a -> a)) in
  solve l as_
  |> (function
    | None -> print_endline "Impossible"
    | Some route ->
        print_endline "Possible";
        List.iter (Printf.printf "%d\n") route)