#include <bits/stdc++.h>
using namespace std;
long long m, n, num[1010][1010], fc[1010 * 1010], cnt, qxf, qyf, qx, qy, qd, qg,
    x, y, dp[1010 * 1010], ans;
pair<long long, long long> pos[1010 * 1010];
inline long long get(pair<long long, long long> u) {
  return num[u.first][u.second];
}
inline bool cmp(pair<long long, long long> u, pair<long long, long long> v) {
  return num[u.first][u.second] > num[v.first][v.second];
}
inline bool cmp2(long long u, long long v) { return u > v; }
inline long long po(long long u, long long v) {
  long long res = 1;
  for (; v;) {
    if (v & 1) res = res * u % 998244353;
    u = u * u % 998244353;
    v >>= 1;
  }
  return res;
}
inline void add(long long u, long long v, long long w) {
  qxf += u * u;
  qxf %= 998244353;
  qyf += v * v;
  qyf %= 998244353;
  qx += 2 * u;
  qx %= 998244353;
  qy += 2 * v;
  qy %= 998244353;
  qd += dp[w];
  qd %= 998244353;
}
inline void work(long long u, long long v) {
  long long i, p, q, t;
  t = m * n - v;
  t = po(t, 998244353 - 2);
  for (i = u; i <= v; i++) {
    p = pos[i].first, q = pos[i].second;
    dp[i] = (qd + qxf + qyf - qx * p % 998244353 - qy * q % 998244353 +
             998244353 * 2) %
            998244353;
    dp[i] = dp[i] * t % 998244353;
    dp[i] = (dp[i] + p * p + q * q) % 998244353;
    if (p == x && q == y) {
      cout << dp[i];
      exit(0);
    }
  }
  for (i = u; i <= v; i++) {
    add(pos[i].first, pos[i].second, i);
  }
}
int main() {
  long long i, j, t;
  cin >> m >> n;
  for (i = 1; i <= m; i++) {
    for (j = 1; j <= n; j++) {
      scanf("%lld", &num[i][j]);
      pos[(i - 1) * n + j] = make_pair(i, j);
    }
  }
  cin >> x >> y;
  sort(pos + 1, pos + n * m + 1, cmp);
  for (i = 2; i <= m * n; i++) {
    if (get(pos[i]) != get(pos[i - 1])) {
      fc[++cnt] = i - 1;
    }
  }
  fc[++cnt] = n * m;
  for (i = fc[cnt - 1] + 1; i <= fc[cnt]; i++) {
    if (pos[i].first == x && pos[i].second == y) {
      puts("0");
      return 0;
    }
    add(pos[i].first, pos[i].second, i);
  }
  for (i = cnt - 1;; i--) {
    work(fc[i - 1] + 1, fc[i]);
  }
}
