#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll KMOD = 998244353;
ll Power(ll a, ll pow, ll p) {
  if (pow == 1) return a;
  ll x = Power(a, pow / 2, p);
  ll y = x * x % p;
  if (pow % 2 == 0) return y;
  return y * a % p;
}
ll ModInverse(ll a, ll p) { return Power(a, p - 2, p); }
struct Fraction {
  Fraction(ll n, ll d) : num(n), den(d) {}
  Fraction() {}
  ll num = 0;
  ll den = 1;
};
Fraction Add(Fraction f1, Fraction f2) {
  ll num = (f1.num * f2.den + f1.den * f2.num) % KMOD;
  ll den = f1.den * f2.den % KMOD;
  return {num, den};
}
Fraction Divide(Fraction f, ll d) { return {f.num, f.den * d % KMOD}; }
Fraction MakeFraction(ll x) { return {x, 1}; }
Fraction Zero() { return {0, 1}; }
int n, m, r, c;
struct Cell {
  Cell(int r, int c, int v) : row(r), col(c), val(v) {}
  Cell() {}
  int row, col, val;
  bool operator<(const Cell& c) const { return val < c.val; }
};
vector<Cell> cells;
void Load() {
  scanf("%d%d", &n, &m);
  cells.resize(n * m);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      int temp;
      scanf("%d", &temp);
      cells[i * m + j] = Cell(i, j, temp);
    }
  }
  scanf("%d%d", &r, &c);
  r--, c--;
  int start_val;
  for (const auto& cell : cells) {
    if (cell.row == r && cell.col == c) {
      start_val = cell.val;
      break;
    }
  }
  sort((cells).begin(), (cells).end());
  for (int i = 0; i < cells.size(); ++i) {
    if (cells[i].val == start_val) {
      cells.resize(i);
      cells.push_back({r, c, start_val});
      break;
    }
  }
}
vector<vector<Cell>> GetCellsAtRank() {
  vector<vector<Cell>> cells_at_rank;
  for (const Cell& cell : cells) {
    if (!cells_at_rank.empty() && cell.val == cells_at_rank.back()[0].val) {
      cells_at_rank.back().push_back(cell);
    } else {
      cells_at_rank.push_back({cell});
    }
  }
  return cells_at_rank;
}
void Solve() {
  auto cells_at_rank = GetCellsAtRank();
  ll cells_encountered = 0;
  Fraction e_score_psum;
  ll sq_psum = 0;
  ll x_psum = 0, y_psum = 0;
  for (int i = 0; i < cells_at_rank.size(); ++i) {
    ll x_addl = 0, y_addl = 0, sq_addl = 0;
    Fraction e_score_addl;
    for (const Cell& cell : cells_at_rank[i]) {
      x_addl += cell.col;
      y_addl += cell.row;
      sq_addl += cell.col * cell.col + cell.row * cell.row;
      ll t_dist = (i == 0 ? 0
                          : cells_encountered * (cell.col * cell.col +
                                                 cell.row * cell.row) +
                                sq_psum - 2 * cell.col * x_psum -
                                2 * cell.row * y_psum) %
                  KMOD;
      Fraction e_score_this =
          i == 0 ? Zero()
                 : Divide(Add(e_score_psum, MakeFraction(t_dist)),
                          cells_encountered);
      if (cell.col == c && cell.row == r) {
        printf("%lld\n",
               e_score_this.num * ModInverse(e_score_this.den, KMOD) % KMOD);
        return;
      }
      e_score_addl = Add(e_score_addl, e_score_this);
    }
    cells_encountered += cells_at_rank[i].size();
    x_psum += x_addl;
    y_psum += y_addl;
    sq_psum += sq_addl;
    e_score_psum = Add(e_score_psum, e_score_addl);
  }
}
int main() {
  Load();
  Solve();
  return 0;
}
