#include <bits/stdc++.h>
using namespace std;
long long int a[1005][1005];
long long int dp[1005][1005];
long long int Fact[1000005];
long long int InvFact[1000005];
long long int InvMe[1000005];
long long int bigmod(long long int n, long long int r) {
  if (r == 0) return 1LL;
  long long int ret = bigmod(n, r / 2);
  ret = (ret * ret) % 998244353;
  if (r % 2 == 1) ret = (ret * n) % 998244353;
  return ret;
}
long long int invmod(long long int n) { return bigmod(n, 998244353 - 2); }
long long int Mul(long long int a, long long int b) {
  return (a * b) % 998244353;
}
long long int Add(long long int a, long long int b) {
  return a + b >= 998244353 ? a + b - 998244353 : a + b;
}
vector<pair<int, pair<int, int> > > Numbers;
vector<pair<int, pair<int, int> > > Curr;
int main() {
  Fact[0] = InvFact[0] = 1;
  for (int i = 1; i < 1000005; i++) Fact[i] = (Fact[i - 1] * i) % 998244353;
  InvFact[1000005 - 1] = invmod(Fact[1000005 - 1]);
  for (int i = 1000005 - 2; i >= 1; i--)
    InvFact[i] = (InvFact[i + 1] * (i + 1)) % 998244353;
  for (int i = 1000005 - 2; i >= 1; i--)
    InvMe[i] = (Fact[i - 1] * InvFact[i]) % 998244353;
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      scanf("%d", &a[i][j]);
      Numbers.push_back({a[i][j], {i, j}});
    }
  sort(Numbers.begin(), Numbers.end());
  long long int Count = 0, SumX = 0, SumY = 0, SumSq = 0, SumAns = 0;
  for (int i = 0; i < Numbers.size(); i++) {
    Curr.clear();
    for (int j = i; j < Numbers.size(); j++) {
      if (Numbers[j].first > Numbers[i].first) break;
      Curr.push_back(Numbers[j]);
    }
    long long int NowCount = 0, NowSumX = 0, NowSumY = 0, NowSumSq = 0,
                  NowSumAns = 0;
    for (int j = 0; j < Curr.size(); j++) {
      long long int n = Curr[j].first;
      long long int x = Curr[j].second.first;
      long long int y = Curr[j].second.second;
      dp[x][y] = SumAns;
      dp[x][y] = Add(dp[x][y], Mul(Count, Mul(x, x)));
      dp[x][y] = Add(dp[x][y], Mul(Count, Mul(y, y)));
      dp[x][y] = Add(dp[x][y], SumSq);
      long long int Temp = Add(Mul(x, SumX), Mul(y, SumY));
      Temp = Add(Temp, Temp);
      Temp = 998244353 - Temp;
      dp[x][y] = Add(dp[x][y], Temp);
      dp[x][y] = Mul(dp[x][y], InvMe[Count]);
      NowCount++;
      NowSumX = Add(NowSumX, x);
      NowSumY = Add(NowSumY, y);
      NowSumSq = Add(NowSumSq, Mul(x, x));
      NowSumSq = Add(NowSumSq, Mul(y, y));
      NowSumAns = Add(NowSumAns, dp[x][y]);
    }
    Count = Add(Count, NowCount);
    SumX = Add(SumX, NowSumX);
    SumY = Add(SumY, NowSumY);
    SumSq = Add(SumSq, NowSumSq);
    SumAns = Add(SumAns, NowSumAns);
    i += Curr.size() - 1;
  }
  int r, c;
  scanf("%d %d", &r, &c);
  printf("%lld\n", dp[r][c]);
}
