#include <iostream>
using namespace std;
int main()
{
    int m; //dimenzija 1
    int n; //dimenzija 2
    int mat1[200][200]; // input matrica
    int mat2[200][200]; // matrica najmanjih vrednosti
    int m1, n1; //lokacije zabranjenog polja
    //cout << "dimenzije matrice:";
    cin >> m >> n;
    //cout << "matrica cena:";
    for (int i = 0; i < m; i++)
    {
        for (int j = 0; j < n; j++)
        {
            cin >> mat1[i][j];
        }
    }
    //cout << "kordinate zabranjenog polja";
    int throw1;
    cin >> throw1;
    cin >> m1 >> n1;
    m1--;
    n1--;
    mat2[0][0] = mat1[0][0];
    for (int i = 1; i < m + n - 1; i++) //idemo po dijagonalama
    {
        int dd;//duzina dijagonale
        int manjakoo = min(m, n);
        if (i < manjakoo)
        {
            dd = i + 1;
        }
        else if (i > m + n - manjakoo - 2)
        {
            dd = m + n - 1 - i;
        }
        else
        {
            dd = manjakoo;
        }
        for (int j = 0; j < dd; j++)
        {
            int m2, n2;//koordinate polja o kom se ovde radi
            if (i < m + n - manjakoo)
            {
                n2 = j;
                m2 = i - j;
            }
            else
            {
                n2 = j + i - (m + n - manjakoo) +1 ;
                m2 = i - n2;
            }

            if (n2 == n1 && m2 == m1)
            {
                mat2[m2][n2] = 2100000000;
            }
            else if (m2 == 0)
            {
                mat2[m2][n2] = mat2[m2][n2 - 1] + mat1[m2][n2];
            }
            else if (n2 == 0)
            {
                mat2[m2][n2] = mat2[m2 - 1][n2] + mat1[m2][n2];
            }
            else
            {
                mat2[m2][n2] = mat1[m2][n2] + min(mat2[m2 - 1][n2], mat2[m2][n2 - 1]);
            }

        }
    }


    /*for (int i = 0; i < m; i++)
    {
        cout << '\n';
        for (int j = 0; j < n; j++)
        {
            cout << mat2[i][j] << "   ";
        }
    }*/
    cout << mat2[m - 1][n - 1];
}