#include <bits/stdc++.h>
using namespace std;
const int N = 1000010, mod = 998244353, INF = 0x3f3f3f3f;
const double eps = 1e-6;
int n, m, tot;
long long f[N], pref, prex, prey, prex2, prey2, pre;
struct Node {
  long long x, y, val;
  bool operator<(const Node &w) const { return val < w.val; }
} a[N];
long long qmi(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans % mod;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      long long x;
      scanf("%lld", &x);
      a[++tot] = {i, j, x};
    }
  sort(a + 1, a + 1 + tot);
  int cnt = 0;
  a[0].val = -1;
  for (int i = 2; i <= tot; i++) {
    if (a[i].val != a[i - 1].val) {
      int pos = i - 1, val = a[i - 1].val;
      while (pos >= 1 && a[pos].val == val)
        (prex += a[pos].x) %= mod, (prey += a[pos].y) %= mod,
            (prex2 += a[pos].x * a[pos].x) %= mod,
            (prey2 += a[pos].y * a[pos].y) %= mod, (pre += f[pos]) %= mod,
            pos--, cnt++;
      f[i] = ((pre + (a[i].x * a[i].x + a[i].y * a[i].y) * cnt + prex2 + prey2 -
               2 * a[i].x * prex - 2 * a[i].y * prey) %
                  mod +
              mod) %
             mod * qmi(cnt, mod - 2) % mod;
    } else
      f[i] = ((pre + (a[i].x * a[i].x + a[i].y * a[i].y) * cnt + prex2 + prey2 -
               2 * a[i].x * prex - 2 * a[i].y * prey) %
                  mod +
              mod) %
             mod * qmi(cnt, mod - 2) % mod;
  }
  long long ans = -1;
  int sx, sy;
  cin >> sx >> sy;
  for (int i = 1; i <= tot; i++)
    if (a[i].x == sx && a[i].y == sy) {
      ans = f[i];
      break;
    }
  cout << ans % mod << endl;
  return 0;
}
