#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
const long long maxn = 1e6 + 5;
long long n, m, inv[maxn], edx, edy, f[maxn], sx, sx2, sy, sy2, sf, cnt, tot;
long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  return x * f;
}
struct P {
  long long x, y, val;
} a[maxn];
bool cmp(P a, P b) { return a.val < b.val; }
void pre_inv() {
  inv[1] = 1;
  for (long long i = 2; i <= tot; i++) {
    inv[i] = (-inv[mod % i] * (mod / i) % mod + mod) % mod;
  }
  return;
}
signed main() {
  n = read();
  m = read();
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      a[++tot].x = i;
      a[tot].y = j;
      a[tot].val = read();
    }
  }
  sort(a + 1, a + tot + 1, cmp);
  edx = read(), edy = read();
  pre_inv();
  for (long long i = 1, j = 1; i <= tot;) {
    while (a[j].val == a[j + 1].val) j++;
    if (!cnt) {
      for (long long k = i; k <= j; k++) f[k] = 0;
    } else {
      for (long long k = i; k <= j; k++) {
        f[k] = (cnt * a[k].x % mod * a[k].x % mod - 2 * a[k].x * sx % mod +
                sx2 + cnt * a[k].y % mod * a[k].y % mod -
                2 * a[k].y * sy % mod + sy2 + sf) %
               mod * inv[cnt] % mod;
      }
    }
    for (long long k = i; k <= j; k++) {
      if (a[k].x == edx && a[k].y == edy) {
        cout << (f[k] + mod) % mod;
        return 0;
      }
      cnt++;
      sx = (sx + a[k].x) % mod;
      sx2 = (sx2 + a[k].x * a[k].x % mod) % mod;
      sy = (sy + a[k].y) % mod;
      sy2 = (sy2 + a[k].y * a[k].y % mod) % mod;
      sf = (sf + f[k]) % mod;
    }
    j++;
    i = j;
  }
  return 0;
}
