#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 5;
struct tile {
  long long r, c, val;
  bool operator<(const tile &rhs) const { return val < rhs.val; }
};
vector<tile> v;
long long n, m, r, c, dp[N], sum[N], sumr[N], sumc[N];
long long fpow(long long a, long long p, long long mod) {
  if (!p) return 1;
  long long ans = fpow(a, p >> 1, mod);
  ans = ans * ans % mod;
  if (p & 1) ans = ans * a % mod;
  return ans;
}
long long inv(long long a, long long mod) { return fpow(a, mod - 2, mod); }
void add(long long &x, long long y) {
  y %= 998244353;
  x += y;
  if (x >= 998244353) x -= 998244353;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) {
      long long a;
      cin >> a;
      v.push_back({i, j, a});
    }
  cin >> r >> c;
  r--, c--;
  sort(v.begin(), v.end());
  long long pos;
  for (long long i = 0; i < v.size(); i++) {
    if (i && v[i].val != v[i - 1].val) {
      pos = i;
      break;
    }
    dp[i] = 0;
    sum[i] = (i ? sum[i - 1] : 0);
    sumr[i] = (i ? sumr[i - 1] : 0);
    sumc[i] = (i ? sumc[i - 1] : 0);
    add(sum[i], dp[i]);
    add(sum[i], v[i].r * v[i].r + v[i].c * v[i].c);
    add(sumr[i], 2 * v[i].r);
    add(sumc[i], 2 * v[i].c);
    if (v[i].r == r && v[i].c == c) {
      cout << dp[i];
      return 0;
    }
  }
  long long lst = pos - 1;
  for (long long i = pos; i < v.size(); i++) {
    if (v[i].val != v[i - 1].val) lst = i - 1;
    dp[i] = sum[lst] - v[i].r * sumr[lst] % 998244353 -
            v[i].c * sumc[lst] % 998244353 +
            (lst + 1) * (v[i].r * v[i].r + v[i].c * v[i].c);
    dp[i] = (dp[i] + 1LL * 998244353 * 998244353) % 998244353;
    dp[i] = dp[i] * inv(lst + 1, 998244353) % 998244353;
    sum[i] = sum[i - 1];
    sumr[i] = sumr[i - 1];
    sumc[i] = sumc[i - 1];
    add(sum[i], dp[i]);
    add(sum[i], v[i].r * v[i].r + v[i].c * v[i].c);
    add(sumr[i], 2 * v[i].r);
    add(sumc[i], 2 * v[i].c);
    if (v[i].r == r && v[i].c == c) {
      cout << dp[i];
      return 0;
    }
  }
  return 0;
}
