# your code goes here #rabirynce def ab(a1): if a1<0: a1*=-1 return a h,w=(int(i) for i in input().split()) sx,sy,gx,gy=(int(i) for i in input().split()) b=[[int(i) for i in input().split()] for i in range(H)] vn=[[sx,sy]] v=[[0,0]] Nd=0 i=0 a=[[0]*w]*h while Nd<1 and vn!=[] and i=0 and ux=0 and uyb[ux][uy]: k1=k*2 u1x=tx+k1 l1=l*2 u1y=ty+l1 if u1x>=0 and u1x=0 and u1y