import sys input = sys.stdin.readline from collections import * from heapq import * H, W, X, Y = map(int, input().split()) X -= 1 Y -= 1 A = [list(map(int, input().split())) for _ in range(H)] f = [[False]*W for _ in range(H)] f[X][Y] = True pq = [] for nx, ny in [(X-1, Y), (X+1, Y), (X, Y-1), (X, Y+1)]: if 0<=nx