#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
int n, m, r, c;
inline long long add(long long a, long long b) { return (a + b) % MOD; }
inline long long sub(long long a, long long b) {
  long long c = (a - b) % MOD;
  if (c < 0) c += MOD;
  return c;
}
inline long long mul(long long a, long long b) { return a * b % MOD; }
struct P {
  int v;
  long long x, y;
  P() {}
  P(int v, long long x, long long y) : v(v), x(x), y(y) {}
};
vector<P> s;
bool cmp(const P& a, const P& b) {
  if (a.v != b.v)
    return a.v >= b.v;
  else if (a.x != b.x)
    return a.x < b.x;
  return a.y < b.y;
}
long long extgcd(long long a, long long b, long long& x, long long& y) {
  long long d = a;
  if (b != 0) {
    d = extgcd(b, a % b, y, x);
    y -= (a / b) * x;
  } else {
    x = 1, y = 0;
  }
  return d;
}
long long inv(long long q) {
  long long x, y;
  extgcd(q, MOD, x, y);
  return (MOD + x % MOD) % MOD;
}
long long calc(long long Pr, long long Prx, long long Pry, long long Prxy,
               long long Pr_E, P p) {
  long long res = Pr_E;
  res = add(res, mul(p.x * p.x + p.y * p.y, Pr));
  res = sub(res, mul(2 * p.x, Prx));
  res = sub(res, mul(2 * p.y, Pry));
  res = add(res, Prxy);
  return res;
}
void solve() {
  sort(s.begin(), s.end(), cmp);
  int i = 0;
  while (s[i].x != r || s[i].y != c) i++;
  while (++i < s.size() && s[i].v == s[i - 1].v)
    ;
  long long Pr = inv(s.size() - i), Prx = mul(Pr, r), Pry = mul(Pr, c),
            Prxy = mul(Pr, r * r + c * c), Pr_E = 0, E = 0;
  for (int j = i; i < s.size();) {
    E = 0;
    do {
      E = add(E, calc(Pr, Prx, Pry, Prxy, Pr_E, s[i]));
    } while (++i < s.size() && s[i].v == s[i - 1].v);
    long long _p = inv(s.size() - i);
    long long Prob_to_next = mul(Pr, _p);
    for (; j < i; j++) {
      Pr = add(Pr, Prob_to_next);
      Prx = add(Prx, mul(Prob_to_next, s[j].x));
      Pry = add(Pry, mul(Prob_to_next, s[j].y));
      Prxy = add(Prxy, mul(Prob_to_next, s[j].x * s[j].x + s[j].y * s[j].y));
    }
    Pr_E = add(Pr_E, mul(_p, E));
  }
  cout << E << endl;
}
int main() {
  FILE* in = fopen("input.txt", "r");
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    for (int j = 0, tmp; j < m; j++) {
      scanf("%d", &tmp);
      s.push_back(P(tmp, i, j));
    }
  }
  scanf("%d %d", &r, &c);
  r--;
  c--;
  solve();
  return 0;
}
