#include <bits/stdc++.h>
using namespace std;
template <class T>
void pv(vector<T> &vec) {
  for (int i = 0; i < (int)(vec).size(); i++)
    cout << vec[i] << (i == (int)(vec).size() - 1 ? '\n' : ' ');
}
const long long MOD = 998244353;
long long n, m, R, C;
vector<vector<long long>> matrix, dp;
vector<pair<long long, pair<long long, long long>>> inc;
long long sum_ev = 0, sum_r_i_sq = 0, sum_two_r_i = 0, sum_c_i_sq = 0,
          sum_two_c_i = 0, k = 0;
void input() {
  cin >> n >> m;
  dp.resize(n);
  for (int i = 0; i < n; i++) dp[i].assign(m, 0);
  matrix.resize(n);
  for (int i = 0; i < n; i++) {
    matrix[i].resize(m);
    for (int j = 0; j < m; j++) {
      cin >> matrix[i][j];
      inc.push_back({matrix[i][j], {i, j}});
    }
  }
  sort(inc.begin(), inc.end());
  cin >> R >> C;
  R--;
  C--;
}
void modadd(long long &x, long long y) { x = (((x + y) % MOD) + MOD) % MOD; }
void modmul(long long &x, long long y) { x = (((x * y) % MOD) + MOD) % MOD; }
long long mul(long long x, long long y) {
  return (((x * y) % MOD) + MOD) % MOD;
}
long long expo(long long a, long long x) {
  if (x == 0) return 1LL;
  if (x == 1) return a % MOD;
  long long base = expo(a, x / 2LL);
  modmul(base, base);
  if (x & 1LL) modmul(base, a);
  return base;
}
long long inv(long long x) { return expo(x, MOD - 2LL); }
void count_elem(long long x, long long y, long long k_inv) {
  if (k == 0) return;
  long long now = mul(sum_ev, k_inv);
  modadd(now, (x * x) % MOD);
  modadd(now, (y * y) % MOD);
  modadd(now, mul(sum_r_i_sq, k_inv));
  modadd(now, mul(sum_c_i_sq, k_inv));
  modadd(now, mul(mul(-x, sum_two_r_i), k_inv));
  modadd(now, mul(mul(-y, sum_two_c_i), k_inv));
  dp[x][y] = now;
}
void update_sums(long long x, long long y) {
  modadd(sum_ev, dp[x][y]);
  modadd(sum_r_i_sq, (x * x) % MOD);
  modadd(sum_c_i_sq, (y * y) % MOD);
  modadd(sum_two_r_i, (2 * x) % MOD);
  modadd(sum_two_c_i, (2 * y) % MOD);
}
void solve() {
  long long l = 0;
  while (l < (int)(inc).size()) {
    long long r = l;
    while (r < (int)(inc).size() && inc[r].first == inc[l].first) r++;
    for (long long i = l; i < r; i++)
      count_elem(inc[i].second.first, inc[i].second.second, k ? inv(k) : -1);
    for (long long i = l; i < r; i++)
      update_sums(inc[i].second.first, inc[i].second.second);
    k += r - l;
    l = r;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  input();
  solve();
  cout << dp[R][C] << '\n';
  return 0;
}
