#include <bits/stdc++.h>
using namespace std;

int main()
{
	long long int n,k,c,uk=0,i,j,cc,brn=0;
	
	cin>>n>>k>>c;
	long long int niz[n];
	cc=c;
	for(i=0;i<n;i++)
	{
		cin>>niz[i];
		if(niz[i]<0)
		brn++;
	}
	
	for(i=0;i<n-k+1;i++)
	{
		uk=0;
		c=1;
		for(j=i;j<i+k;j++)
		{
			uk=uk+c*niz[j];
			cout<<"cc = "<<cc<<"  c= "<<c<<endl;
			if((niz[j]<=0)&&(cc>c)&&(brn>0))
			{
				c++;
			}
			else if ((cc>c)&&(brn<1))
			{
				c++;
			}
			
		}
		cout<<uk<<" "<<c<<endl;
	}
}