/*
#include <stdio.h>
int main()
{
int arr[171][171]={},n,m,i,j,l,s,sum=0,summ=0,cnt,o,max=-1,p;
scanf("%d %d", &n, &m);
for (i=m+11;i<=n+m+11-1;i++)
{
for (j=m+11;j<=n+m+11-1;j++)
{
scanf("%d", &arr[i][j]);
}
}
for (l=m+11;l<=n+11+m-1;l++)
{
for (s=11+m;s<=n+11+m-1;s++)
{
o=l;
p=s;
sum=arr[o][p];
summ=arr[o][p];
i=o-1;
j=p;
for (cnt=1;cnt<=m;i--,cnt++)
{
sum+=arr[i][j];
}
i=o;
j=p+1;
for (cnt=1;cnt<=m;cnt++,j++)
{
sum+=arr[i][j];
}
i=o+1;
j=p;
for (cnt=1;cnt<=m;cnt++,i++)
{
sum+=arr[i][j];
}
i=o;
j=p-1;
for (cnt=1;cnt<=m;cnt++,j--)
{
sum+=arr[i][j];
}
i=o-1;
j=p-1;
for (cnt=1;cnt<=m;cnt++,j--,i--)
{
summ+=arr[i][j];
}
i=o-1;
j=p+1;
for (cnt=1;cnt<=m;cnt++,i--,j++)
{
summ+=arr[i][j];
}
i=o+1;
j=p+1;
for (cnt=1;cnt<=m;cnt++,i++,j++)
{
summ+=arr[i][j];
}
i=o+1;
j=p-1;
for (cnt=1;cnt<=m;cnt++,i++,j--)
{
summ+=arr[i][j];
}
if ((sum>summ ? sum : summ) > max)
{
max = (sum>summ ? sum : summ);
}
}
}
printf("%d", max);
return 0;
}
*/