#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2000008;
long long mod = 998244353;
pair<long long, long long> p[maxn];
int id[maxn];
int val[maxn];
long long sum[maxn];
long long dp[maxn];
int getid(int x, int y) { return x * 1005 + y; }
int cmp(int x, int y) { return val[x] < val[y]; }
long long rev(long long x) {
  int y = mod - 2;
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % mod;
    x = x * x % mod;
    y = y / 2;
  }
  return res;
}
long long totsx, totssx;
long long totsy, totssy;
void ins(long long i) {
  totsx += p[i].first;
  totssx += p[i].first * p[i].first;
  totsx %= mod, totssx %= mod;
  totsy += p[i].second;
  totssy += p[i].second * p[i].second;
  totsy %= mod, totssy %= mod;
}
int main() {
  long long n, m;
  cin >> n >> m;
  long long kl = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int t = getid(i, j);
      scanf("%d", &val[t]);
      id[kl++] = t;
      p[t].first = i + 1, p[t].second = j + 1;
    }
  }
  sort(id, id + n * m, cmp);
  int lst = 0;
  int x1, y1;
  cin >> x1 >> y1;
  for (int i = 0; i < n * m; i++) {
    while (val[id[lst]] < val[id[i]]) ins(id[lst]), lst++;
    if (lst > 0) dp[i] = sum[lst - 1];
    dp[i] += lst * p[id[i]].first % mod * p[id[i]].first;
    dp[i] %= mod;
    dp[i] += totssx;
    dp[i] %= mod;
    dp[i] -= 2 * totsx * p[id[i]].first % mod;
    dp[i] %= mod;
    dp[i] += lst * p[id[i]].second % mod * p[id[i]].second;
    dp[i] %= mod;
    dp[i] += totssy;
    dp[i] %= mod;
    dp[i] -= 2 * totsy * p[id[i]].second % mod;
    dp[i] %= mod;
    dp[i] = dp[i] * rev(lst) % mod;
    if (id[i] == getid(x1 - 1, y1 - 1)) {
      cout << (dp[i] + mod) % mod;
      return 0;
    }
    if (i)
      sum[i] = sum[i - 1] + dp[i];
    else
      sum[i] = dp[i];
  }
  return 0;
}
