#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
const long long MOD = 1e9 + 7;
const double eps = 1e-9;
int n, m, sr, sc, a[N][N], dp[N][N], mod = 998244353;
vector<pair<int, pair<int, int> > > v;
int fast_pow(int b, int n) {
  if (n == 1) return b;
  if (n == 0) return 1;
  if (n & 1) return (1ll * b * fast_pow(b, n - 1)) % mod;
  int r = fast_pow(b, n / 2);
  return (1ll * r * r) % mod;
}
inline int inverse(int x) { return fast_pow(x, mod - 2); }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      scanf("%d", &a[i][j]);
      v.push_back(make_pair(a[i][j], make_pair(i, j)));
    }
  }
  scanf("%d%d", &sr, &sc);
  sr--, sc--;
  sort(v.begin(), v.end());
  int sev = 0, srow = 0, scol = 0, srow2 = 0, scol2 = 0;
  for (int i = 0, j, x, y, iv; i < v.size();) {
    j = i;
    iv = inverse(i);
    while (j < v.size() && v[j].first == v[i].first) j++;
    if (i)
      for (int k = i; k < j; k++) {
        x = v[k].second.first, y = v[k].second.second;
        if (!i) continue;
        dp[x][y] = ((1ll * x * x) % mod + (1ll * y * y) % mod) % mod;
        dp[x][y] = (dp[x][y] + (1ll * sev * iv) % mod) % mod;
        dp[x][y] = (dp[x][y] + (1ll * srow2 * iv) % mod) % mod;
        dp[x][y] = (dp[x][y] + (1ll * scol2 * iv) % mod) % mod;
        dp[x][y] =
            (dp[x][y] - (1ll * (2ll * x * srow) % mod * iv) % mod + mod) % mod;
        dp[x][y] =
            (dp[x][y] - (1ll * (2ll * y * scol) % mod * iv) % mod + mod) % mod;
      }
    for (int k = i; k < j; k++) {
      x = v[k].second.first, y = v[k].second.second;
      sev = (sev + dp[x][y]) % mod;
      srow = (srow + x) % mod;
      scol = (scol + y) % mod;
      srow2 = (srow2 + (1ll * x * x) % mod) % mod;
      scol2 = (scol2 + (1ll * y * y) % mod) % mod;
    }
    i = j;
  }
  printf("%d\n", dp[sr][sc]);
  return 0;
}
