#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1.1e6;
const int MOD = 998244353;
struct A {
  long long x, y;
  long long val;
  bool t;
  bool operator<(const A& _) const { return val < _.val; }
} a[MAXN];
int n, m;
long long p[MAXN], q[MAXN], r[MAXN], s[MAXN], f[MAXN];
long long inv(long long x) {
  long long ret = 1;
  int c = MOD - 2;
  long long b = x;
  while (c) {
    if (c & 1) {
      ret = ret * b % MOD;
    }
    c >>= 1;
    b = b * b % MOD;
  }
  return ret;
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      int idx = (i - 1) * m + j;
      cin >> a[idx].val;
      a[idx].x = i;
      a[idx].y = j;
    }
  }
  int x, y;
  cin >> x >> y;
  a[(x - 1) * m + y].t = true;
  n *= m;
  sort(a + 1, a + 1 + n);
  a[0].val = -1;
  int ecnt;
  for (int i = 1; i <= n; i++) {
    if (a[i].val == a[i - 1].val) {
      ecnt++;
    } else {
      ecnt = 1;
    }
    f[i] = (f[i] + r[i - ecnt]) % MOD;
    f[i] = (f[i] + s[i - ecnt]) % MOD;
    f[i] =
        (f[i] + (a[i].x * a[i].x + a[i].y * a[i].y) % MOD * (i - ecnt) % MOD) %
        MOD;
    f[i] = ((f[i] - 2 * a[i].x % MOD * p[i - ecnt] % MOD) % MOD + MOD) % MOD;
    f[i] = ((f[i] - 2 * a[i].y % MOD * q[i - ecnt] % MOD) % MOD + MOD) % MOD;
    f[i] = f[i] * inv(i - ecnt) % MOD;
    if (a[i].t == true) {
      cout << f[i];
      break;
    }
    p[i] = (p[i - 1] + a[i].x) % MOD;
    q[i] = (q[i - 1] + a[i].y) % MOD;
    r[i] = ((r[i - 1] + a[i].x * a[i].x % MOD) % MOD + a[i].y * a[i].y % MOD) %
           MOD;
    s[i] = (s[i - 1] + f[i]) % MOD;
  }
  return 0;
}
