#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "inline")
using namespace std;
const int N = 1005;
const int MOD = 998244353;
int n, m, R, C, tot;
int pos[N][N], dp[N * N];
long long sdp[N * N], sj[N * N], si[N * N];
struct No {
  int v, x, y;
  friend bool operator<(No a, No b) { return a.v < b.v; }
} a[N * N];
inline long long Sqr(long long x) { return x * x % MOD; }
int Inv(int x, int b = MOD - 2) {
  static int re;
  for (re = 1; b; b >>= 1, x = (long long)x * x % MOD)
    if (b & 1) re = (long long)re * x % MOD;
  return re;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, x; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      scanf("%d", &x);
      a[++tot] = (No){x, i, j};
    }
  }
  scanf("%d%d", &R, &C);
  sort(a + 1, a + 1 + tot);
  for (int i = 1; i <= tot; ++i) {
    pos[a[i].x][a[i].y] = i;
  }
  for (int i = 1, j, r = 0; i <= tot; r = j, i = j + 1) {
    for (j = i; j < tot && a[j + 1].v == a[i].v; ++j)
      ;
    if (r != 0) {
      int inv = Inv(r);
      for (int k = i; k <= j; ++k) {
        dp[k] = sdp[r] * inv % MOD;
        dp[k] = (dp[k] - 2LL * a[k].x * inv % MOD * si[r] % MOD) % MOD;
        dp[k] = (dp[k] - 2LL * a[k].y * inv % MOD * sj[r] % MOD) % MOD;
        dp[k] = (dp[k] + Sqr(a[k].x) + Sqr(a[k].y)) % MOD;
      }
    }
    for (int k = i; k <= j; ++k) {
      sdp[k] = (sdp[k - 1] + dp[k] + Sqr(a[k].x) + Sqr(a[k].y)) % MOD;
      si[k] = (si[k - 1] + a[k].x) % MOD;
      sj[k] = (sj[k - 1] + a[k].y) % MOD;
    }
  }
  printf("%d\n", (dp[pos[R][C]] % MOD + MOD) % MOD);
  return 0;
}
