#include <bits/stdc++.h>
const double PI = acos(-1.0);
const int DIR = 4;
const int X[] = {1, 0, -1, 0};
const int Y[] = {0, 1, 0, -1};
const int MOD = 998244353;
const int N = 1005;
using namespace std;
struct Point {
  int val, x, y;
};
bool cmp(Point a, Point b) { return a.val < b.val; }
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % MOD;
    a = a * a % MOD;
    b >>= 1;
  }
  return res;
}
int n, m, a[N][N];
long long res[N][N];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) scanf("%d", &a[i][j]);
  int x1, qwer1234;
  scanf("%d%d", &x1, &qwer1234);
  vector<Point> p;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) p.push_back({a[i][j], i, j});
  sort(p.begin(), p.end(), &cmp);
  long long A = 0, B = 0, C = 0, D = 0;
  int k = 0;
  for (int i = 0; i < (int)p.size(); i++) {
    int x = p[i].x, y = p[i].y;
    while (p[k].val < p[i].val) {
      A = (A + p[k].x * p[k].x + p[k].y * p[k].y) % MOD;
      B = (B + p[k].x) % MOD;
      C = (C + p[k].y) % MOD;
      D = (D + res[p[k].x][p[k].y]) % MOD;
      k++;
    }
    res[x][y] = (A + D + 1ll * k * x * x + 1ll * k * y * y) % MOD;
    res[x][y] = (res[x][y] - (2ll * x * B % MOD) + MOD) % MOD;
    res[x][y] = (res[x][y] - (2ll * y * C % MOD) + MOD) % MOD;
    res[x][y] = res[x][y] * binpow(k, MOD - 2) % MOD;
  }
  cout << res[x1][qwer1234] << endl;
  return 0;
}
