#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long mod = 998244353;
const int maxn = 1005;
const int maxm = 30;
const double eps = 1e-6;
int n, m;
struct node {
  long long x, y;
  int num;
  long long sum;
  bool operator<(const node &s) const { return num < s.num; }
} a[maxn * maxn];
int now = 0;
long long qpow(long long a, long long b) {
  if (b < 0) return 0;
  long long ans = 1;
  a %= mod;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    b >>= 1, a = (a * a) % mod;
  }
  return ans % mod;
}
void solve() {
  long long cnt = 0;
  long long sum_x1 = 0;
  long long sum_x2 = 0;
  long long sum_y1 = 0;
  long long sum_y2 = 0;
  long long sum = 0;
  for (int i = 1; i <= now; i++) {
    int j = i;
    while (j + 1 <= now && a[j + 1].num == a[j].num) j++;
    for (int k = i; k <= j; k++) {
      a[k].sum = cnt * a[k].x % mod * a[k].x % mod;
      a[k].sum += sum_x2;
      a[k].sum -= 2 * a[k].x * sum_x1 % mod;
      a[k].sum += cnt * a[k].y * a[k].y % mod;
      a[k].sum += sum_y2;
      a[k].sum -= 2 * a[k].y * sum_y1 % mod;
      a[k].sum += sum;
      a[k].sum %= mod;
      a[k].sum *= qpow(cnt, mod - 2);
      a[k].sum %= mod;
    }
    cnt += j - i + 1;
    for (int k = i; k <= j; k++) {
      sum_x1 += a[k].x;
      sum_x2 += a[k].x * a[k].x % mod;
      sum_y1 += a[k].y;
      sum_y2 += a[k].y * a[k].y % mod;
      sum += a[k].sum;
      sum_x1 %= mod;
      sum_x2 %= mod;
      sum_y1 %= mod;
      sum_y2 %= mod;
      sum %= mod;
    }
    i = j;
  }
}
int main() {
  int x, y;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      scanf("%d", &a[++now].num), a[now].x = i, a[now].y = j;
  scanf("%d%d", &x, &y);
  sort(a + 1, a + now + 1);
  solve();
  for (int i = 1; i <= now; i++)
    if (a[i].x == x && a[i].y == y) printf("%lld", a[i].sum), puts("");
  return 0;
}
