#include using namespace std;int h,w,x,y,t=2e6,a,b;vector s(2000);main(){cin>>h>>w;for(int i=0;i> s[i];for(int j=0;j