#include <bits/stdc++.h>
using namespace std;
long long i, b, a, t, k, r, j, l, p, n, m, X, ans, ans1, ans2, ans3, ans4, ans5,
    ans6, c[1000001], c1[1000001], c2[1000001], c3[1000001], g[1000001],
    SUM[1000001];
pair<long long, pair<long long, long long>> arr[1000001];
long long get(long long x, long long y) {
  long long ans = y, h = x, p2 = p - 2;
  while (p2) {
    if (p2 & 1) {
      ans *= h;
      ans %= p;
    }
    p2 /= 2;
    h *= h;
    h %= p;
  }
  return ans;
}
int main() {
  p = 998244353;
  cin >> n;
  cin >> m;
  t = 1;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cin >> arr[t].first;
      arr[t].second.first = i;
      arr[t].second.second = j;
      t++;
    }
  }
  cin >> l;
  cin >> r;
  sort(arr + 1, arr + 1 + n * m);
  for (i = 1; i <= n * m; i++) {
    if (arr[i].second.first == l && arr[i].second.second == r) {
      k = i;
      break;
    }
  }
  for (i = 1; i <= m * n; i++) {
    c[i] = c[i - 1] + (arr[i].second.first % p * arr[i].second.first % p) % p;
    c1[i] =
        c1[i - 1] + (arr[i].second.second % p * arr[i].second.second % p) % p;
    c2[i] = c2[i - 1] + arr[i].second.first % p;
    c3[i] = c3[i - 1] + arr[i].second.second % p;
  }
  for (i = 1; i <= k; i++) {
    if (arr[i].first != arr[i - 1].first) a = i - 1;
    ans1 = (a * (arr[i].second.first * arr[i].second.first) % p) % p;
    ans2 = (a * (arr[i].second.second * arr[i].second.second) % p) % p;
    ans3 = c[a] % p;
    ans4 = c1[a] % p;
    ans5 = ((-2) * c2[a] % p * arr[i].second.first % p) % p;
    ans6 = ((-2) * c3[a] % p * arr[i].second.second % p) % p;
    ans = (ans1 + ans2 + ans3 + ans4 + ans5 + ans6) % p;
    X = get(a, SUM[a] + ans) % p;
    SUM[i] = (SUM[i - 1] + X) % p;
  }
  cout << X;
  return 0;
}
