#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y, val;
  friend bool operator<(node a, node b) { return a.val < b.val; }
};
int row, col, xx, yy, x;
const int MOD = 998244353, maxn = 1000005;
;
long long dp[maxn], sumdp[maxn], sumx[maxn], sumy[maxn], sumxx[maxn],
    sumyy[maxn];
vector<node> V;
long long xpow(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret = ret * a % MOD;
    a = a * a % MOD;
    b >>= 1;
  }
  return ret;
}
int main() {
  scanf("%d%d", &row, &col);
  for (int i = 1; i <= row; i++)
    for (int j = 1; j <= col; j++) scanf("%d", &x), V.push_back({i, j, x});
  scanf("%d%d", &xx, &yy);
  sort(V.begin(), V.end());
  for (int i = 0; i < (int)V.size(); i++) {
    sumx[i] = ((i != 0) * sumx[i - 1] + V[i].x) % MOD;
    sumy[i] = ((i != 0) * sumy[i - 1] + V[i].y) % MOD;
    sumxx[i] = ((i != 0) * sumxx[i - 1] + V[i].x * V[i].x % MOD) % MOD;
    sumyy[i] = ((i != 0) * sumyy[i - 1] + V[i].y * V[i].y % MOD) % MOD;
  }
  for (int i = 0; i < (int)V.size(); i++) {
    int pos = lower_bound(V.begin(), V.end(), V[i]) - V.begin();
    if (pos) {
      dp[i] = ((sumdp[pos - 1] - 2LL * sumx[pos - 1] * V[i].x % MOD -
                2LL * sumy[pos - 1] * V[i].y % MOD + sumxx[pos - 1] +
                sumyy[pos - 1] + 1LL * V[i].x * V[i].x * pos % MOD +
                1LL * V[i].y * V[i].y * pos % MOD) %
                   MOD +
               MOD) %
              MOD;
      dp[i] = dp[i] * xpow(pos, MOD - 2) % MOD;
      sumdp[i] = (dp[i] + sumdp[i - 1]) % MOD;
    }
    if (V[i].x == xx && V[i].y == yy) {
      printf("%lld\n", dp[i]);
      return 0;
    }
  }
  return 0;
}
