Scanf.scanf "%d %d" @@ fun h w ->
  let sh =
    Array.init (h*w) (fun _ -> Scanf.scanf " %c" (fun c ->
      if c = '#' then 1 else 0))
    |> Array.fold_left (+) 0
  in print_endline @@ if h+w-1 = sh then "Possible" else "Impossible"