#include <bits/stdc++.h>
using namespace std;
template <class T, class T2>
inline int chkmax(T &x, const T2 &y) {
  return x < y ? x = y, 1 : 0;
}
template <class T, class T2>
inline int chkmin(T &x, const T2 &y) {
  return x > y ? x = y, 1 : 0;
}
const int MAXN = (1 << 10);
const int mod = 998244353;
int pw(int x, int p) {
  int r = 1;
  while (p) {
    if (p & 1) r = r * 1ll * x % mod;
    x = x * 1ll * x % mod;
    p >>= 1;
  }
  return r;
}
int inv(int x) { return pw(x, mod - 2); }
inline int sq(int x) { return x * 1ll * x % mod; }
int n, m, r, c;
int a[MAXN][MAXN];
void read() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  cin >> r >> c;
}
int dp[MAXN][MAXN];
inline int val(pair<int, int> o) { return a[o.first][o.second]; }
bool cmp(pair<int, int> i, pair<int, int> j) { return val(i) < val(j); }
void solve() {
  vector<pair<int, int> > li;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) li.push_back({i, j});
  sort(li.begin(), li.end(), cmp);
  int sum_dp = 0, sum_x = 0, sum_y = 0, sum_x2 = 0, sum_y2 = 0;
  for (int i = 0; i < n * m;) {
    int j = i;
    while (i < n * m && val(li[i]) == val(li[j])) i++;
    int prob = inv(j);
    for (int p = j; p < i; p++) {
      auto &memo = dp[li[p].first][li[p].second];
      int x = li[p].first, y = li[p].second;
      memo = (memo + (sq(x) * 1ll * j)) % mod;
      memo = (memo + (sq(y) * 1ll * j)) % mod;
      memo = (memo - (x * 2ll * sum_x) % mod + mod) % mod;
      memo = (memo - (y * 2ll * sum_y) % mod + mod) % mod;
      memo = (memo + (sum_x2)) % mod;
      memo = (memo + (sum_y2)) % mod;
      memo = (memo + sum_dp) % mod;
      memo = memo * 1ll * prob % mod;
    }
    for (int p = j; p < i; p++) {
      int x = li[p].first, y = li[p].second;
      sum_x = (sum_x + x) % mod;
      sum_x2 = (sum_x2 + sq(x)) % mod;
      sum_y = (sum_y + y) % mod;
      sum_y2 = (sum_y2 + sq(y)) % mod;
      sum_dp = (sum_dp + dp[x][y]) % mod;
    }
  }
  cout << dp[r][c] << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  read();
  solve();
  return 0;
}
