#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int MOD = 998244353;
const double EPS = 1e-9;
int n, m;
long long mpow(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % MOD;
    x = x * x % MOD;
    y >>= 1;
  }
  return res;
}
struct gg {
  long long r, c, x;
  gg() {}
  gg(long long r, long long c, long long x) : r(r), c(c), x(x) {}
  bool operator<(const gg &g) const { return x < g.x; }
} g[1000015];
long long sumrc, sumr, sumc, dp[1000015], sum[1000015], I[1000015];
int R, C;
int main() {
  scanf("%d%d", &n, &m);
  I[1] = 1;
  for (int i = 2; i <= n * m; ++i) {
    I[i] = (MOD - MOD / i) * I[MOD % i] % MOD;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      int x;
      scanf("%d", &x);
      g[(i - 1) * m + j] = gg(i, j, x);
    }
  }
  scanf("%d%d", &R, &C);
  sort(g + 1, g + n * m + 1);
  int id = 0;
  for (int i = 1; i <= n * m;) {
    int j = i + 1;
    while (j <= n * m && g[i].x == g[j].x) ++j;
    for (int k = i; k < j; ++k) {
      if (1 == i) break;
      long long c = g[k].c, r = g[k].r;
      dp[k] +=
          c * c + r * r +
          (sum[i - 1] + sumrc - 2 * r * sumr - 2 * c * sumc) % MOD * I[i - 1];
      dp[k] = (dp[k] % MOD + MOD) % MOD;
    }
    for (int k = i; k < j; ++k) {
      long long c = g[k].c, r = g[k].r;
      if (r == R && c == C) {
        id = k;
        break;
      }
      sumrc = (sumrc + c * c + r * r) % MOD;
      sumr = (sumr + r) % MOD;
      sumc = (sumc + c) % MOD;
      sum[k] = (sum[k - 1] + dp[k]) % MOD;
    }
    if (id) break;
    i = j;
  }
  printf("%lld\n", dp[id]);
  return 0;
}
