#include <bits/stdc++.h>
using namespace std;
vector<pair<long long int, pair<int, int> > > v;
long long int a[1005][1005], n, m, r, c, xs[1000005], xsq[1000005], y[1000005],
    ysq[1000005], ys[1000005], dp[1000005];
long long int mod = 998244353;
long long int p(long long int a, long long int b) {
  long long int r = 1;
  while (b) {
    if (b % 2) r = (r * a) % mod;
    a = (a * a) % mod;
    b /= 2;
  }
  return r;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> a[i][j];
      v.push_back(make_pair(a[i][j], make_pair(i, j)));
    }
  }
  cin >> r >> c;
  sort(v.begin(), v.end());
  long long int lst = -1;
  int sz = v.size();
  for (int i = 0; i <= sz - 1; i++) {
    if (i) {
      if (v[i].first != v[i - 1].first) lst = i - 1;
    }
    long long int val = v[i].first;
    long long int x = v[i].second.first;
    long long int y = v[i].second.second;
    if (lst != -1) {
      long long int xsq1 = (x * x) % mod;
      long long int ysq1 = (y * y) % mod;
      long long int ans = (dp[lst] + xsq1 * (lst + 1)) % mod;
      ans = (ans + ysq1 * (lst + 1)) % mod;
      ans = (ans + xsq[lst] + ysq[lst]) % mod;
      long long int kx = (2 * xs[lst]) % mod;
      kx = (kx * x) % mod;
      long long int ky = (2 * ys[lst]) % mod;
      ky = (ky * y) % mod;
      ans = (ans - kx - ky) % mod;
      ans = (ans * p(lst + 1, mod - 2)) % mod;
      ans = (ans + mod) % mod;
      dp[i] = ans;
    }
    if (x == r && y == c) {
      cout << dp[i];
      return 0;
    }
    if (i) {
      dp[i] = (dp[i] + dp[i - 1]) % mod;
      xsq[i] = (xsq[i - 1] + x * x) % mod;
      xs[i] = (xs[i - 1] + x) % mod;
      ysq[i] = (ysq[i - 1] + y * y) % mod;
      ys[i] = (ys[i - 1] + y) % mod;
    } else {
      xsq[i] = (x * x) % mod;
      xs[i] = x;
      ysq[i] = (y * y) % mod;
      ys[i] = y;
    }
  }
  return 0;
}
