Language: C++

#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) REP(i,0,n)
#define REP(i,a,n) for(int i = a ; i < (int)n ; i++)

int H, W;
string map[10];
int dx[] = {1, 0}; //, -1, 0};
int dy[] = {0, 1}; //, 0, 1};

void dump(){
  rep(i,H){
    rep(j, W){
      cout << map[i][j];
    }
    puts("");
  }
  puts("");
}

void solve(int x, int y){

  map[y][x] = '.';
  
  if(x == W-1 && y == H-1){
    rep(i,H){
    rep(j, W){
      if(map[i][j]=='#'){
	cout << "Impossible" << endl;
	exit(0);
      }
    }
  }

    cout << "Possible" << endl;
    exit(0);
  }
  
  //dump();
  //cout << "x: " << x << " y: " << y << endl;
  rep(i, 2){
    int nx = x + dx[i]; int ny = y + dy[i];

    if(0 <= nx && nx < W && 0 <= ny && ny < H && map[ny][nx]=='#') { // && x <= nx && y <= ny){
      //cout << "nx :" << nx << " ny : " << ny << endl;
      solve(nx, ny);
      //cout << "x: " << x << " y: " << y << endl;
    }
  }

}

int main(){
  cin >> H >> W;
  
  rep(i, H){
    cin >> map[i];
  }
  
  solve(0,0);
  
  rep(i,H){
    rep(j, W){
      if(map[i][j]=='#'){
	cout << "Impossible" << endl;
	exit(0);
      }
    }
  }
  
  cout << "Possible" << endl;    
}


Compiler output:
a.cc: In function 'void dump()':
a.cc:16:15: error: reference to 'map' is ambiguous
   16 |       cout << map[i][j];
      |               ^~~
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:9:8: note:                 'std::string map [10]'
    9 | string map[10];
      |        ^~~
a.cc: In function 'void solve(int, int)':
a.cc:25:3: error: reference to 'map' is ambiguous
   25 |   map[y][x] = '.';
      |   ^~~
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:9:8: note:                 'std::string map [10]'
    9 | string map[10];
      |        ^~~
a.cc:30:10: error: reference to 'map' is ambiguous
   30 |       if(map[i][j]=='#'){
      |          ^~~
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:9:8: note:                 'std::string map [10]'
    9 | string map[10];
      |        ^~~
a.cc:46:50: error: reference to 'map' is ambiguous
   46 |     if(0 <= nx && nx < W && 0 <= ny && ny < H && map[ny][nx]=='#') { // && x <= nx && y <= ny){
      |                                                  ^~~
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:9:8: note:                 'std::string map [10]'
    9 | string map[10];
      |        ^~~
a.cc: In function 'int main()':
a.cc:59:12: error: reference to 'map' is ambiguous
   59 |     cin >> map[i];
      |            ^~~
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:9:8: note:                 'std::string map [10]'
    9 | string map[10];
      |        ^~~
a.cc:66:10: error: reference to 'map' is ambiguous
   66 |       if(map[i][j]=='#'){
      |          ^~~
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:9:8: note:                 'std::string map [10]'
    9 | string map[10];
      |        ^~~