#include <bits/stdc++.h>
using namespace std;
const int N = 1001;
const int p = 998244353;
int n, m;
struct data {
  int x, y, c;
} a[N * N];
int x, y;
long long inv[N * N];
long long f[N * N];
long long s, sf, sx, sx2, sy, sy2;
void read(int &x) {
  char ch = getchar();
  x = 0;
  for (; ch < '0' || ch > '9'; ch = getchar())
    ;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    x = (x << 3) + (x << 1) + ch - '0';
}
int cmp(const data &q, const data &w) { return q.c < w.c; }
void Add(long long &x, long long y) {
  x += y;
  while (x < 0) x += p;
  while (x >= p) x -= p;
}
inline long long sqr(long long x) { return x * x; }
int main() {
  read(n);
  read(m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      read(x);
      a[(i - 1) * m + j] = (data){i, j, x};
    }
  read(x);
  read(y);
  n *= m;
  sort(a + 1, a + 1 + n, cmp);
  inv[1] = 1;
  for (int i = 2; i <= n; i++) inv[i] = (-p / i * inv[p % i]) % p;
  a[n + 1].c = -1;
  for (int i = 1; i <= n; i++) {
    if (s) {
      Add(f[i], (s * sqr(a[i].x) % p - 2 * sx * a[i].x % p + sx2) % p);
      Add(f[i], (s * sqr(a[i].y) % p - 2 * sy * a[i].y % p + sy2) % p);
      Add(f[i], sf);
      f[i] = f[i] * inv[s] % p;
    } else
      f[i] = 0;
    if (a[i].x == x && a[i].y == y) {
      cout << (f[i] + p) % p << endl;
      exit(0);
    }
    if (a[i].c != a[i + 1].c)
      for (int j = i; j; j--) {
        if (a[j].c != a[i].c) break;
        Add(sf, f[j]);
        Add(sx, a[j].x);
        Add(sx2, sqr(a[j].x));
        Add(sy, a[j].y);
        Add(sy2, sqr(a[j].y));
        s++;
      }
  }
  return 0;
}
