#include using namespace std; using ll=long long; int main(){ int h,w; cin>>h>>w; vector s(h); for(int i=0;i>s[i]; vector> a(h,vector(w)),b(h,vector(w)); a[0][0]=true; b[h-1][w-1]=true; for(int i=0;i=0;i--)for(int j=w-1;j>=0;j--){ if(b[i][j]){ if(i>0&&s[i-1][j]!='#')b[i-1][j]=true; if(j>0&&s[i][j-1]!='#')b[i][j-1]=true; } } if(a[h-1][w-1]){ cout< ca(h,w),ra(w,h),cb(h,-1),rb(w,-1); for(int i=0;i