#include <iostream>
#include<fstream>

long int m,n,i,j,m1,n1,tong=0,a[10000][10000],tongmax,vt,vt1;

using namespace std;
long long duyet(long int i, long int j,long int m1,long int n1)
{
    int i1,j1;
    long long tong=0;
        for(i1=i;i1<=i+m1-1;i1++)
		    for(j1=j;j1<=j+n1-1;j1++)
            tong=tong+a[i1][j1];

   return tong;
}
int main()
{

    fstream fi,fo;
    fi.open("matranmax.inp",ios::in);
    fo.open("matranmax.out",ios::out);
    fi>>m>>n>>m1>>n1;
       for(i=1;i<=m;i++ )
        for(j=1;j<=n;j++)
       {
    fi>>a[i][j];
       }
       for(i=1;i<=m-m1+1;i++)
        for(j=1;j<=n-n1+1;j++)
       {
           tong=duyet(i,j,m1,n1);
           if(tong>tongmax)
           {
               tongmax=tong;
           }
       }
       fo<<tongmax<<endl<<n1<<" "<<m1;
    return 0;
}
