#include <bits/stdc++.h>
using namespace std;
inline void read(long long &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
inline void write(long long x) {
  static const long long maxlen = 100;
  static char s[maxlen];
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (!x) {
    putchar('0');
    return;
  }
  long long len = 0;
  for (; x; x /= 10) s[len++] = x % 10 + '0';
  for (long long i = len - 1; i >= 0; --i) putchar(s[i]);
}
template <typename T>
T gcd(T m, T n) {
  if (!m || !n) return m | n;
  if (m < 0) m = -m;
  if (n < 0) n = -n;
  long long p = 0;
  while (!(m & 1) && !(n & 1)) m >>= 1, n >>= 1, ++p;
  while (n) {
    while (!(m & 1)) m >>= 1;
    while (!(n & 1)) n >>= 1;
    if (m >= n) std::swap(m, n);
    n = (n - m) >> 1;
  }
  return m << p;
}
template <typename T>
std::pair<T, std::pair<T, T> > exgcd(T m, T n) {
  using std::make_pair;
  T x = 0, y = 1, xp = 1, yp = 0, xt, yt;
  for (T r = m % n, q = m / n; r;) {
    xt = xp - q * x, xp = x, x = xt;
    yt = yp - q * y, yp = y, y = yt;
    m = n, n = r, r = m % n, q = m / n;
  }
  return make_pair(n, make_pair(x, y));
}
template <typename T>
T modinv(T m, T n) {
  if (m == 0) return 0;
  std::pair<T, std::pair<T, T> > gxy = exgcd(m, n);
  T loop = n / gxy.first;
  T inv = gxy.second.first;
  inv = inv % loop;
  return inv < 0 ? inv + loop : inv;
}
const long long MAXN = 1010;
long long n, m;
long long r, c;
long long g[MAXN][MAXN];
struct KT {
  long long x, y, val;
} a[MAXN * MAXN];
bool cmp_val(KT A, KT B) { return A.val > B.val; }
const long long P = 998244353;
map<long long, long long> M;
void doit(long long st, long long &ans) {
  long long cnt_all = 0;
  long long U = 0, V = 0;
  for (int i = 1; i <= n * m; i++)
    if (a[i].val < a[st].val) {
      U = (U + a[i].x * a[i].x % P) % P;
      V = (V + a[i].x % P) % P;
      cnt_all++;
    }
  long long now = 1;
  for (long long i = st; i <= n * m; i++) {
    if (a[i].val == a[n * m].val) break;
    {
      int j = i;
      while ((j < n * m) && (a[j + 1].val == a[i].val)) j++;
      for (int k = i; k <= j; k++)
        ans = ((ans + now *
                          ((a[k].x * a[k].x % P + (U - 2 * a[k].x * V % P) % P *
                                                      modinv(cnt_all, P) % P)) %
                          P) %
                   P +
               P) %
              P;
      if (i == st) {
        if (j != n * m) now = modinv(n * m - j, P) % P;
      } else if (j != n * m)
        now = (now + now * M[a[i].val] % P * modinv(n * m - j, P) % P) % P;
      i = j;
    }
    if ((i != n * m) && (a[i + 1].val != a[i].val)) {
      long long nex = i;
      while ((nex != n * m) && (a[nex + 1].val == a[i + 1].val)) {
        nex++;
        U = ((U - a[nex].x * a[nex].x % P) % P + P) % P;
        V = ((V - a[nex].x % P) % P + P) % P;
        cnt_all--;
      }
    }
  }
}
int main() {
  read(n);
  read(m);
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) {
      read(g[i][j]);
      a[(i - 1) * m + j].val = g[i][j];
      a[(i - 1) * m + j].x = i;
      a[(i - 1) * m + j].y = j;
      M[g[i][j]] = M[g[i][j]] + 1;
    }
  read(r);
  read(c);
  sort(a + 1, a + n * m + 1, cmp_val);
  long long st = 0;
  for (long long i = 1; i <= n * m; i++)
    if ((a[i].x == r) && (a[i].y == c)) {
      st = i;
      while ((st < n * m) && (a[st + 1].val == a[i].val)) st++;
      swap(a[st], a[i]);
      break;
    }
  long long ans = 0;
  doit(st, ans);
  for (long long i = 1; i <= n * m; i++) swap(a[i].x, a[i].y);
  swap(n, m);
  doit(st, ans);
  printf("%I64d\n", ans);
  return 0;
}
