/*
#include <stdio.h>
int main()
{
int arr [101] [101]= {0};
int i,j,n,k=1, sum=0;
scanf("%d",&n);
for (i=1; i<=n; i++)
{
for(j=1; j<=n; j++)
{
arr[i][j]=k;
k++;
}
}
for (i=1; i<=n; i++)
{
for (j=1; j<=n; j++)
{
if(i==1||i==n||j==1||j==n)
{
sum=sum+arr[i][j];
}
}
}
printf("%d",sum);
}
*/
#include <stdio.h>
int main ()
{
int arr [82] [82]={0};
int i,j,r,c;
for(i=1;i<=r;i++)
{
for(j=1;j<=c;j++)
{
scanf("%d", &arr[i][j]);
}
}
scanf ("%d %d",&r, &c);
}