#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
const int maxn = 1000050;
int a[maxn], r[maxn], c[maxn], r0, c0;
int idx[maxn];
long long inv[maxn];
long long addmod(long long x, long long y) { return (x + y) % MOD; }
long long mulmod(long long x, long long y) {
  x %= MOD, y %= MOD;
  return x * y % MOD;
}
long long sumv[maxn], sumr[maxn], sumr2[maxn], sumc[maxn], sumc2[maxn];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  const int N = n * m;
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      scanf("%d", &a[++cnt]);
      r[cnt] = i, c[cnt] = j;
      idx[cnt] = cnt;
    }
  }
  scanf("%d%d", &r0, &c0);
  sort(idx + 1, idx + 1 + N, [](int x, int y) { return a[x] < a[y]; });
  inv[1] = 1;
  int p = 0;
  for (int i = 1; i <= N; ++i) {
    int u = idx[i];
    if (i > 1) inv[i] = mulmod(inv[MOD % i], MOD - MOD / i);
    if (a[u] != a[idx[i - 1]]) p = i - 1;
    long long ans = 0;
    ans = addmod(ans, sumv[p]);
    ans = addmod(ans, sumr2[p]);
    ans = addmod(ans, -sumr[p] * 2 * r[u]);
    ans = addmod(ans, (long long)r[u] * r[u] * p);
    ans = addmod(ans, sumc2[p]);
    ans = addmod(ans, -sumc[p] * 2 * c[u]);
    ans = addmod(ans, (long long)c[u] * c[u] * p);
    ans = mulmod(ans, inv[p]);
    if (r[u] == r0 && c[u] == c0) {
      ans = (ans % MOD + MOD) % MOD;
      cout << ans << endl;
      return 0;
    }
    sumv[i] = addmod(sumv[i - 1], ans);
    sumr[i] = addmod(sumr[i - 1], r[u]);
    sumr2[i] = addmod(sumr2[i - 1], (long long)r[u] * r[u]);
    sumc[i] = addmod(sumc[i - 1], c[u]);
    sumc2[i] = addmod(sumc2[i - 1], (long long)c[u] * c[u]);
  }
  return 0;
}
