#include<iostream>
using namespace std;
int shu[100];
int main()
{
int num,i,j,sam,ella;
cin>>num;
while(num)
{
sam=ella=0;
for(i=0;i<num;i++)
cin>>shu[i];
j=num-1;
i=0;
sam+=shu[i];
ella+=shu[j];
while(i!=j-1)
{
if(sam>ella)
{
j--;
ella+=shu[j];
}
else
{
i++;
sam+=shu[i];
}
}
if(sam==ella)
cout<<"Sam stops at position "<<i+1
<<" and Ella stops at position "<<j+1
<<"."<<endl;
else
cout<<"No equal partitioning."<<endl;
cin>>num;
}
return 0;
}