while True: try: a = list(map(int,input().split())) b = list(map(int,input().split())) c = list(map(int,input().split())) d = list(map(int,input().split())) e = list(map(int,input().split())) size_r,size_c = a[0],a[1] x1,y1,x2,y2 = b[0],b[1],b[2],b[3] r = c[0] c = d[0] x,y = e[0],e[1] # check q1 if ...