#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
const long long mod = 998244353;
struct node {
  long long x, y, val;
};
bool cmp(node a1, node b1) { return a1.val < b1.val; }
node a[maxn];
long long fpm(long long a, long long p) {
  long long r = 1, base = a;
  while (p) {
    if (p & 1) r = r * base % mod;
    base = base * base % mod;
    p /= 2;
  }
  return r;
}
long long n, dp[maxn], inv[maxn], m, sx, sy, cnt, sumx2[maxn], sumy2[maxn],
    sumx[maxn], sumy[maxn], sumdp[maxn];
void init() {
  for (int i = 1; i <= cnt; i++) {
    inv[i] = fpm(i, mod - 2);
  }
}
int main() {
  cin >> n >> m;
  long long tp;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%lld", &tp);
      node t1;
      t1.x = i;
      t1.y = j;
      t1.val = tp;
      cnt++;
      a[cnt] = t1;
    }
  }
  cin >> sx >> sy;
  init();
  sort(a + 1, a + cnt + 1, cmp);
  int last = 0;
  for (int i = 1; i <= cnt; i++) {
    if (i != 1 && a[i].val != a[i - 1].val) last = i - 1;
    long long x = a[i].x, y = a[i].y;
    dp[i] = (last * x * x % mod + last * y * y % mod + sumx2[last] +
             sumy2[last] + mod - 2 * x * sumx[last] % mod -
             2 * y * sumy[last] % mod + sumdp[last]) %
            mod;
    dp[i] = (dp[i] * inv[last]) % mod;
    if (x == sx && y == sy) {
      cout << dp[i] << endl;
      return 0;
    }
    sumx2[i] = (sumx2[i - 1] + x * x) % mod;
    sumy2[i] = (sumy2[i - 1] + y * y) % mod;
    sumy[i] = (sumy[i - 1] + y) % mod;
    sumx[i] = (sumx[i - 1] + x) % mod;
    sumdp[i] = (sumdp[i - 1] + dp[i]) % mod;
  }
}
