#include <iostream>
using namespace std;
int main()
{int a[n],b[n],n,i,j,k[n];
cin>>n;
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++)
for(j=0;j<n;j++)
b[i]+=a[j]; // b[i]=b[i]+a[j] <=> b[i]+=a[j]
int max=0;
for(i=0;i<n;i++)
if(b[i]>max)
{max=b[i];
k=i;}
cout<<"suma maxima = "<<max;
cout<<" in pozitile <<" " <<k<<" ";
for(i=0l;i<n;i++)
if(b[i]=max)
cout<<i<<" ";
}