#include <bits/stdc++.h>
using namespace std;
struct Cell {
  int a, x, y;
};
Cell a[1000010];
long long pq[1000010], spq[1000010];
long long sqi[1000010], sqj[1000010], si[1000010], sj[1000010];
int n, m, r, c, v;
long long mpow(long long base, long long exp) {
  long long res = 1;
  while (exp > 0) {
    if (exp & 1) {
      res = (res * base) % 998244353LL;
    }
    exp >>= 1;
    base = (base * base) % 998244353LL;
  }
  return res;
}
long long inv(long long k) { return mpow(k, 998244353LL - 2); }
bool compare(const Cell &c1, const Cell &c2) { return c1.a < c2.a; }
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  v = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> a[v].a;
      a[v].x = i;
      a[v].y = j;
      v++;
    }
  }
  cin >> r >> c;
  sort(a + 1, a + v, compare);
  int l = 0;
  pq[0] = 0;
  spq[0] = 0;
  sqi[0] = 0;
  sqj[0] = 0;
  si[0] = 0;
  sj[0] = 0;
  long long num, numx, numy;
  for (int b = 1; b < v; b++) {
    while ((l < b) && a[l + 1].a < a[b].a) {
      l++;
    }
    si[b] = si[b - 1] + a[b].x;
    sj[b] = sj[b - 1] + a[b].y;
    sqi[b] = sqi[b - 1] + a[b].x * a[b].x;
    sqj[b] = sqj[b - 1] + a[b].y * a[b].y;
    if (l != 0) {
      numx =
          (long long)(a[b].x * a[b].x) * (long long)(l)-2LL * si[l] * a[b].x +
          sqi[l];
      numy =
          (long long)(a[b].y * a[b].y) * (long long)(l)-2LL * sj[l] * a[b].y +
          sqj[l];
      num = numx + numy;
      num %= 998244353LL;
      pq[b] = ((spq[l] + num) * inv(l)) % 998244353LL;
      spq[b] = (spq[b - 1] + pq[b]) % 998244353LL;
    } else {
      pq[b] = 0;
      spq[b] = 0;
    }
    if (a[b].x == r && a[b].y == c) {
      cout << pq[b] << endl;
      return 0;
    }
  }
  return 0;
}
