#include <bits/stdc++.h>
using namespace std;
int i, j, m, n, p, k;
int id[1005 * 1005], a[1005 * 1005], b[1005 * 1005], c[1005 * 1005], R, C, tot,
    prob, probt, w1, w2, w3, ans;
int cmp(int x, int y) { return a[x] > a[y]; }
int power(int x, int y) {
  int sum = 1;
  for (; y; y >>= 1) {
    if (y & 1) sum = 1ll * sum * x % 998244353;
    x = 1ll * x * x % 998244353;
  }
  return sum;
}
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= m; ++j) {
      ++tot;
      id[tot] = tot;
      scanf("%d", &a[tot]);
      b[tot] = i;
      c[tot] = j;
    }
  scanf("%d%d", &R, &C);
  sort(id + 1, id + tot + 1, cmp);
  for (i = 1; i <= tot; i = j) {
    for (j = i; j <= tot && a[id[i]] == a[id[j]]; ++j)
      ;
    for (k = i; k < j; ++k) {
      int p = id[k];
      int probt = 0;
      if (b[p] == R && c[p] == C)
        probt = 1;
      else
        probt = prob;
      ans = (ans + w1) % 998244353;
      ans = (ans + 1ll * prob * (b[p] * b[p] + c[p] * c[p]) % 998244353) %
            998244353;
      ans = (ans - 1ll * w2 * b[p] % 998244353 + 998244353) % 998244353;
      ans = (ans - 1ll * w3 * c[p] % 998244353 + 998244353) % 998244353;
    }
    int wt = prob;
    for (k = i; k < j; ++k) {
      int p = id[k];
      int probt = 0;
      if (b[p] == R && c[p] == C)
        probt = 1;
      else
        probt = wt;
      probt = 1ll * probt * power(tot - j + 1, 998244353 - 2) % 998244353;
      prob = (prob + probt) % 998244353;
      w1 = (w1 + 1ll * (b[p] * b[p] + c[p] * c[p]) * probt % 998244353) %
           998244353;
      w2 = (w2 + 2ll * probt * b[p] % 998244353) % 998244353;
      w3 = (w3 + 2ll * probt * c[p] % 998244353) % 998244353;
    }
  }
  printf("%d\n", ans);
}
