#include <bits/stdc++.h>
using namespace std;
const int N = 1001;
const int M = 998244353;
int R, C;
int r, c;
vector<pair<int, int> > v;
int g[N][N];
int dp[N * N];
int p[N * N];
int sum[N * N][2];
int Pow(int b, int p) {
  if (!p) return 1;
  long long z = Pow(b, p / 2);
  if (p & 1) return z * z % M * b % M;
  return z * z % M;
}
int main() {
  scanf("%d%d", &R, &C);
  v.reserve(R * C);
  for (int i = 0; i < R; ++i)
    for (int j = 0; j < C; ++j) {
      scanf("%d", &g[i][j]);
      v.push_back({i, j});
    }
  sort(v.begin(), v.end(),
       [&](const pair<int, int> &a, const pair<int, int> &b) {
         return g[a.first][a.second] > g[b.first][b.second];
       });
  vector<int> val;
  val.reserve(R * C);
  for (auto x : v) val.push_back(g[x.first][x.second]);
  scanf("%d%d", &r, &c);
  --r;
  --c;
  int nxt = R * C;
  for (int i = R * C - 1; i >= 0; --i) {
    int cr = v[i].first;
    int cc = v[i].second;
    long long res = 0;
    if (nxt != R * C) {
      res += dp[nxt];
      long long count = R * C - nxt;
      res += count * cr * cr;
      res += count * cc * cc;
      res += -2ll * cr * sum[nxt][0];
      res += -2ll * cc * sum[nxt][1];
      res %= M;
      res *= Pow(count, M - 2);
    }
    dp[i] = (res % M + M) % M;
    if (cr == r && cc == c) {
      printf("%d\n", dp[i]);
      return 0;
    }
    dp[i] = (dp[i] + cr * cr + cc * cc) % M;
    sum[i][0] = (sum[i + 1][0] + cr) % M;
    sum[i][1] = (sum[i + 1][1] + cc) % M;
    dp[i] += dp[i + 1];
    dp[i] %= M;
    if (i && val[i] != val[i - 1]) nxt = i;
  }
  return 0;
}
