#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
const int maxc = maxn * maxn;
const int MOD = 998244353;
long long mod(long long x) {
  x %= MOD;
  if (x < 0) x += MOD;
  return x;
}
long long modReverse(long long b, long long p) {
  if (1 == b) return 1;
  return modReverse(p % b, p) * (p - p / b) % p;
}
struct cell {
  long long x, y, c;
  bool operator<(const cell& A) const {
    if (c != A.c) return c < A.c;
    if (x != A.x) return x < A.x;
    if (y != A.y) return y < A.y;
  }
  cell() {}
  cell(long long xx, long long yy, long long cc) : x(xx), y(yy), c(cc) {}
};
int n, m;
cell b[maxc];
long long dp[maxc], s[maxc], ssqx[maxc], sx[maxc], ssqy[maxc], sy[maxc];
int r, c;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      int tp;
      scanf("%d", &tp);
      b[i * m + j + 1] = cell(i + 1, j + 1, tp);
    }
  scanf("%d%d", &r, &c);
  sort(b + 1, b + n * m + 1);
  dp[0] = s[0] = sx[0] = sy[0] = ssqx[0] = ssqy[0] = 0;
  long long ans = -1;
  int k;
  for (k = 1; k <= n * m; k++) {
    int x = b[k].x, y = b[k].y;
    if (k > 1 && b[k].c > b[k - 1].c) break;
    if (x == r && y == c) {
      ans = 0;
      break;
    }
    dp[k] = 0;
    s[k] = mod(s[k - 1] + dp[k]);
    sx[k] = mod(sx[k - 1] + x);
    sy[k] = mod(sy[k - 1] + y);
    ssqx[k] = mod(ssqx[k - 1] + mod(x * x));
    ssqy[k] = mod(ssqy[k - 1] + mod(y * y));
  }
  k--;
  if (ans == -1)
    for (int i = k + 1; i <= n * m; i++) {
      if (b[i].c != b[i - 1].c) k = i - 1;
      int x = b[i].x, y = b[i].y;
      dp[i] = mod(s[k] + mod(k * mod(x * x)) + ssqx[k] - mod(2 * x * sx[k]) +
                  mod(k * mod(y * y)) + ssqy[k] - mod(2 * y * sy[k]));
      dp[i] = mod(dp[i] * modReverse(k, MOD));
      if (x == r && y == c) {
        ans = dp[i];
        break;
      }
      s[i] = mod(s[i - 1] + dp[i]);
      sx[i] = mod(sx[i - 1] + x);
      sy[i] = mod(sy[i - 1] + y);
      ssqx[i] = mod(ssqx[i - 1] + mod(x * x));
      ssqy[i] = mod(ssqy[i - 1] + mod(y * y));
    }
  printf("%I64d\n", ans);
  return 0;
}
