#include <bits/stdc++.h>
using namespace std;
static int N, M, P, R, C;
static struct tCell {
  int x, y, val;
  friend bool operator<(const tCell &a, const tCell &b) {
    return a.val < b.val;
  }
} cell[1010 * 1010];
static long long ans[1010][1010], suma, sumx, sumy, sumx2, sumy2;
inline long long pow(long long a, long long b) {
  long long ans = 1;
  for (; b; b >>= 1, a = a * a % 998244353LL)
    if (b & 1) ans = ans * a % 998244353LL;
  return ans;
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++) {
      cell[P].x = i;
      cell[P].y = j;
      scanf("%d", &cell[P].val);
      P++;
    }
  scanf("%d%d", &R, &C);
  sort(cell, cell + P);
  for (int i = 0, last; i < P; i = last) {
    for (last = i; last < P && cell[last].val == cell[i].val; last++)
      ;
    if (i) {
      long long inv = pow(i, 998244353LL - 2);
      for (int j = i; j < last; j++) {
        long long &t = ans[cell[j].x][cell[j].y];
        long long part0 = (long long)(cell[j].x) * cell[j].x +
                          (long long)(cell[j].y) * cell[j].y;
        long long part1 = sumx * cell[j].x + sumy * cell[j].y;
        long long part2 = sumx2 + sumy2;
        t = (part0 +
             inv *
                 ((suma - part1 * 2 % 998244353LL + part2 + 998244353LL) %
                  998244353LL) %
                 998244353LL) %
            998244353LL;
      }
    }
    for (int j = i; j < last; j++) {
      suma = (suma + ans[cell[j].x][cell[j].y]) % 998244353LL;
      sumx = (sumx + cell[j].x) % 998244353LL;
      sumy = (sumy + cell[j].y) % 998244353LL;
      sumx2 = (sumx2 + (long long)(cell[j].x) * cell[j].x % 998244353LL) %
              998244353LL;
      sumy2 = (sumy2 + (long long)(cell[j].y) * cell[j].y % 998244353LL) %
              998244353LL;
    }
  }
  printf("%lld\n", ans[R][C]);
  return 0;
}
