#include <bits/stdc++.h>
using namespace std;
int a[1010][1010];
int dp[1000010], sum[1000010];
pair<int, pair<int, int> > p[1000010];
bool cmp(pair<int, pair<int, int> > u, pair<int, pair<int, int> > v) {
  return u.first > v.first;
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
int sq(int first) { return 1LL * first * first % 998244353; }
void add(int &u, int v) {
  u += v;
  if (u >= 998244353) u -= 998244353;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int N = 0, id = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  int r, c;
  scanf("%d%d", &r, &c);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      p[++N] = pair<int, pair<int, int> >(a[i][j], pair<int, int>(i, j));
    }
  }
  sort(p + 1, p + N + 1, cmp);
  for (int i = 1; i <= N; i++) {
    if (p[i].second.first == r && p[i].second.second == c) id = i;
  }
  int s = 0, t = 0, sst = 0;
  for (int i = N; i >= 1; i--) {
    int st = i;
    while (p[st].first == p[i].first && st > 0) st--;
    st++;
    int L = st, R = i;
    int tmps = s, tmpt = t, tmpst = sst;
    for (int j = R; j >= L; j--) {
      int first = p[j].second.first, second = p[j].second.second;
      add(tmps, first);
      add(tmpt, second);
      add(tmpst, sq(first));
      add(tmpst, sq(second));
      int vl = 1LL * (N - R) * (sq(first) + sq(second)) % 998244353;
      dp[j] = 1LL * power(N - R, 998244353 - 2, 998244353) *
              (0LL + sum[R + 1] + vl + sst - (2LL * first * s % 998244353) -
               (2LL * second * t % 998244353)) %
              998244353;
      if (dp[j] < 0) dp[j] += 998244353;
      sum[j] = sum[j + 1] + dp[j];
      if (sum[j] >= 998244353) sum[j] -= 998244353;
    }
    s = tmps;
    t = tmpt;
    sst = tmpst;
    i = L;
  }
  printf("%d\n", dp[id]);
  return 0;
}
