#include<bits/stdc++.h>
template <typename _Tp>void read(_Tp &x){
	char ch(getchar());bool f(false);while(!isdigit(ch))f|=ch==45,ch=getchar();
	x=ch&15,ch=getchar();while(isdigit(ch))x=x*10+(ch&15),ch=getchar();
	if(f)x=-x;
}
template <typename _Tp,typename... Args>void read(_Tp &t,Args &...args){read(t);read(args...);}
const int N=200005;
typedef long long ll;
int a[N];
int main(){
	int n;read(n);
	int mx=0;
	ll s=0,S=0;
	for(int i=1;i<=n;++i){
		read(a[i]),mx=std::max(a[i],mx);
		s+=a[i],S+=s;
		printf("%lld\n",S+1LL*i*mx);
	}
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9+7;

int main(){
  
  int n,m; cin>>n>>m;
  ll a{},b{};
  for(int i=0; i<n; i++){
    string s; cin>>s;
    int cnt{};
    for(auto i:s)if(i=='1')cnt++;
    if(cnt%2) a++;
    else b++;
  }
  cout<<a*b<<endl;
  
  
}