#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx")
using namespace std;
const long long INF = 2e9 + 13;
const long long MOD = 998244353;
inline long long madd(long long a, long long b) { return (a + b) % MOD; }
inline long long mmul(long long a, long long b) { return (a * b) % MOD; }
inline long long sq(long long a) { return mmul(a, a); }
long long powmod(long long a, long long b) {
  long long ret = 1LL;
  while (b) {
    if (b % 2) ret = mmul(ret, a);
    a = mmul(a, a);
    b /= 2LL;
  }
  return ret;
}
long long inverse(long long x) { return powmod(x, MOD - 2LL); }
int N, M;
long long E[1005][1005];
vector<pair<long long, pair<int, int> > > ev;
long long sum_x_sq = 0;
long long sum_x = 0;
long long sum_y_sq = 0;
long long sum_y = 0;
long long sum_E = 0;
long long cnt = 0;
vector<long long> v;
vector<pair<int, int> > INS[1005 * 1005];
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> M;
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++) {
      long long x;
      cin >> x;
      ev.push_back(make_pair(x, pair<int, int>(i, j)));
      v.push_back(x);
    }
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  for (auto& y : ev)
    y.first = lower_bound(v.begin(), v.end(), y.first) - v.begin();
  sort(ev.begin(), ev.end());
  for (auto y : ev) INS[y.first].push_back(y.second);
  for (int i = 0; i < 1005 * 1005; i++) {
    long long Tsum_x_sq = sum_x_sq;
    long long Tsum_x = sum_x;
    long long Tsum_y_sq = sum_y_sq;
    long long Tsum_y = sum_y;
    long long Tsum_E = sum_E;
    long long Tcnt = cnt;
    long long inv = inverse(cnt);
    for (auto pt : INS[i]) {
      long long sumD = madd(Tsum_x_sq, mmul(Tcnt, sq(pt.first)));
      sumD -= mmul(2LL, mmul(Tsum_x, pt.first));
      sumD %= MOD;
      sumD += MOD;
      sumD %= MOD;
      sumD = madd(sumD, madd(Tsum_y_sq, mmul(Tcnt, sq(pt.second))));
      sumD -= mmul(2LL, mmul(Tsum_y, pt.second));
      sumD %= MOD;
      sumD += MOD;
      sumD %= MOD;
      long long val = madd(Tsum_E, sumD);
      E[pt.first][pt.second] = mmul(val, inv);
      sum_x_sq = madd(sum_x_sq, sq(pt.first));
      sum_x = madd(sum_x, pt.first);
      sum_y_sq = madd(sum_y_sq, sq(pt.second));
      sum_y = madd(sum_y, pt.second);
      sum_E = madd(sum_E, E[pt.first][pt.second]);
      cnt++;
    }
  }
  int r, c;
  cin >> r >> c;
  cout << E[r][c] << endl;
}
