#include <bits/stdc++.h>
using namespace std;
struct Tile {
  int v;
  int r;
  int c;
};
bool acompare(Tile a, Tile b) { return a.v < b.v; }
Tile tile[1000001];
int n, m, arr_size, pr, pc, k;
long long dp[1000001], dp_c_1[1000001], dp_r_1[1000001], dp_c_2[1000001],
    dp_r_2[1000001];
long long ans;
long long getdiv(long long a, long long b) {
  long long div = 998244353 - 2;
  while (div > 0) {
    if (div & 1 != 0) {
      a = a * b % 998244353;
    }
    b = b * b % 998244353;
    div = div >> 1;
  }
  return a;
}
void init_dp() {
  dp_r_1[1] = tile[1].r;
  dp_c_1[1] = tile[1].c;
  dp_r_2[1] = (tile[1].r * tile[1].r) % 998244353;
  dp_c_2[1] = (tile[1].c * tile[1].c) % 998244353;
}
void upd_dp(int i) {
  dp_r_1[i] = (dp_r_1[i - 1] + tile[i].r) % 998244353;
  dp_c_1[i] = (dp_c_1[i - 1] + tile[i].c) % 998244353;
  dp_r_2[i] = (dp_r_2[i - 1] + (tile[i].r * tile[i].r) % 998244353) % 998244353;
  dp_c_2[i] = (dp_c_2[i - 1] + (tile[i].c * tile[i].c) % 998244353) % 998244353;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &tile[++arr_size].v);
      tile[arr_size].r = i;
      tile[arr_size].c = j;
    }
  }
  scanf("%d%d", &pr, &pc);
  sort(tile + 1, tile + arr_size + 1, acompare);
  if (tile[1].r == pr && tile[1].c == pc) {
    cout << 0 << endl;
    return 0;
  }
  init_dp();
  for (int i = 2; i <= n * m; i++) {
    upd_dp(i);
    long long r_2 = (tile[i].r * tile[i].r) % 998244353;
    long long c_2 = (tile[i].c * tile[i].c) % 998244353;
    long long odd = (r_2 + c_2) % 998244353;
    if (tile[i].v != tile[i - 1].v) {
      k = i - 1;
    }
    odd = (k * odd) % 998244353;
    odd = (((odd + dp_r_2[k]) % 998244353 + dp_c_2[k]) % 998244353 + dp[k]) %
          998244353;
    odd -= (2 * tile[i].r * dp_r_1[k]) % 998244353;
    if (odd < 0) odd += 998244353;
    odd -= (2 * tile[i].c * dp_c_1[k]) % 998244353;
    if (odd < 0) odd += 998244353;
    odd = getdiv(odd, k);
    dp[i] = (dp[i - 1] + odd) % 998244353;
    if (tile[i].r == pr && tile[i].c == pc) {
      ans = odd;
      break;
    }
  }
  cout << ans << endl;
}
