#include <bits/stdc++.h>
using namespace std;
long long n, m, lst, fx, fy, r, dp[1005 * 1005], dph[1005 * 1005];
long long x1s[1005 * 1005], x2s[1005 * 1005], y1s[1005 * 1005],
    y2s[1005 * 1005];
struct node {
  long long x, y, w;
  bool operator<(const node &b) const { return w < b.w; }
  node(long long ax, long long ay, long long aw) {
    x = ax;
    y = ay;
    w = aw;
  }
  node() {}
} g[1005 * 1005];
long long fastmi(long long u, long long v) {
  long long ans = 1;
  while (v) {
    if (v & 1) {
      ans *= u;
      ans %= 998244353;
    }
    u *= u;
    u %= 998244353;
    v >>= 1;
  }
  return ans;
}
int main() {
  scanf("%lld%lld", &n, &m);
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      long long x;
      scanf("%lld", &x);
      g[++r] = node(i, j, x);
    }
  }
  scanf("%lld%lld", &fx, &fy);
  sort(g + 1, g + r + 1);
  lst = 0;
  for (long long i = 1; i <= r; i++) {
    if (g[i].w != g[lst + 1].w) {
      lst = i - 1;
    }
    dp[i] =
        (dph[lst] + x2s[lst] - 2 * x1s[lst] % 998244353 * g[i].x % 998244353 +
         (lst)*g[i].x % 998244353 * g[i].x % 998244353 + y2s[lst] -
         2 * y1s[lst] % 998244353 * g[i].y % 998244353 +
         (lst)*g[i].y % 998244353 * g[i].y % 998244353) %
        998244353 * fastmi(lst, 998244353 - 2) % 998244353;
    dph[i] = dp[i] + dph[i - 1];
    dph[i] %= 998244353;
    x1s[i] = x1s[i - 1] + g[i].x;
    x1s[i] %= 998244353;
    x2s[i] = x2s[i - 1] + g[i].x * g[i].x;
    x2s[i] %= 998244353;
    y1s[i] = y1s[i - 1] + g[i].y;
    y1s[i] %= 998244353;
    y2s[i] = y2s[i - 1] + g[i].y * g[i].y;
    y2s[i] %= 998244353;
    if (g[i].x == fx && g[i].y == fy) {
      cout << dp[i];
      break;
    }
  }
  return 0;
}
