let rec solve ass y x h w trace =
  if y >= h || x >= w || ass.(y).[x] = '.' then false
  else begin
    let c = trace.(y).[x] in
    trace.(y).[x] <- '#';
    let return r = trace.(y).[x] <- c; r in
    if y = h - 1 && x = w - 1 then return (ass = trace)
    else return (solve ass (y + 1) x h w trace || solve ass y (x + 1) h w trace)
  end

let () =
  let h, w = Scanf.scanf "%d %d\n" (fun h w -> h, w) in
  let ass = Array.init h (fun _ -> Scanf.scanf "%s\n" (fun as_ -> as_)) in
  if solve ass 0 0 h w (Array.init h (fun _ -> String.make w '.')) then print_endline "Possible"
  else print_endline "Impossible"
