#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int n, m;
long long f[1000010], inv[1000010];
struct th {
  int x, y, c;
} a[1000010];
int cmp(th x, th y) { return x.c < y.c; }
int main() {
  scanf("%d%d", &n, &m);
  int nn = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      nn++;
      scanf("%d", &a[nn].c);
      a[nn].x = i;
      a[nn].y = j;
    }
  sort(a + 1, a + 1 + nn, cmp);
  inv[1] = 1;
  for (int i = 2; i <= nn; i++) inv[i] = mod - (mod / i * inv[mod % i]) % mod;
  f[0] = 0;
  long long sumf = 0, sumx = 0, sumxx = 0, sumy = 0, sumyy = 0, tf = 0, tx = 0,
            txx = 0, ty = 0, tyy = 0, last = 0;
  for (int i = 1; i <= nn; i++) {
    if (a[i].c != a[i - 1].c) {
      (sumf += tf) %= mod;
      tf = 0;
      (sumx += tx) %= mod;
      tx = 0;
      (sumxx += txx) %= mod;
      txx = 0;
      (sumy += ty) %= mod;
      ty = 0;
      (sumyy += tyy) %= mod;
      tyy = 0;
      last = i - 1;
    }
    f[i] = inv[last] *
           ((((((sumf + sumxx % mod - 2 * a[i].x % mod * sumx % mod) % mod +
                last * a[i].x * a[i].x % mod) %
                   mod +
               sumyy) %
                  mod -
              2 * a[i].y % mod * sumy % mod) %
                 mod +
             last * a[i].y * a[i].y % mod) %
            mod) %
           mod;
    (tf += f[i]) %= mod;
    (tx += a[i].x) %= mod;
    (txx += a[i].x * a[i].x % mod) %= mod;
    (ty += a[i].y) %= mod;
    (tyy += a[i].y * a[i].y % mod) %= mod;
  }
  int x, y;
  scanf("%d%d", &x, &y);
  for (int i = 1; i <= nn; i++) {
    if (a[i].x == x && a[i].y == y) {
      printf("%lld\n", (f[i] + mod) % mod);
      return 0;
    }
  }
}
