{ mapamap; ll@h,@w,@q,n=h*w; rep(q){ ll@y,@x; y=h+1-y; if(amap[x]