#include <bits/stdc++.h>
using namespace std;
const long long lmax = 1999999999;
const long long lmx = 1999999999999999999;
const long long P = 998244353;
long long previous, n, m, r, c, sumr, sumc, sumrc;
vector<pair<pair<long long, long long>, long long> > v;
struct intt {
  long long a[1002][1002], rsum[1000003], csum[1000003], r[1000003], c[1000003],
      ans[1000003];
};
intt U;
long long quik_pow(long long a, long long b) {
  long long x = 1;
  while (b) {
    if (b & 1) x = (x * a) % P;
    a = (a * a) % P;
    b /= 2;
  }
  return (x) % P;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      cin >> U.a[i][j];
    }
  }
  v.push_back({{0, 0}, 0});
  cin >> r >> c;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      if (U.a[r][c] > U.a[i][j]) {
        v.push_back({{U.a[i][j], i}, j});
      }
    }
  }
  v.push_back({{U.a[r][c], r}, c});
  sort(v.begin() + 1, v.end());
  for (long long i = 1; i < v.size(); i++) {
    if (v[i].first.first != v[i - 1].first.first) {
      previous = i - 1;
    }
    U.r[i] = (U.r[i - 1] + v[i].first.second) % P;
    U.c[i] = (U.c[i - 1] + v[i].second) % P;
    U.rsum[i] =
        (U.rsum[i - 1] + (v[i].first.second * v[i].first.second) % P) % P;
    U.csum[i] = (U.csum[i - 1] + (v[i].second * v[i].second) % P) % P;
    sumr = (previous * (v[i].first.second * v[i].first.second) % P) % P;
    sumc = (previous * (v[i].second * v[i].second) % P) % P;
    sumrc = ((sumr + sumc) % P + (U.rsum[previous] + U.csum[previous]) % P) % P;
    sumrc = ((sumrc + P) - ((2 * v[i].first.second) % P) * U.r[previous]) % P;
    sumrc = ((sumrc + P) - ((2 * v[i].second) % P) * U.c[previous]) % P;
    U.ans[i] =
        (U.ans[i - 1] +
         ((sumrc + U.ans[previous]) % P * quik_pow(previous, P - 2) % P) % P) %
        P;
  }
  cout << (U.ans[v.size() - 1] - U.ans[v.size() - 2] + P) % P << endl;
}
