//看做的人挺多,也补一下吧,还没来得及看,哈哈
http://codeforces.com/contest/1195/problem/D1
//这题的题意很好理解,不说了,很简单,应该做快一点的
题解:
对n个数的每一个数都有 这个数n10^(2i) 加上
这个数n10^(2i+1)//i是数的位数 加上就是结果
//交上就错,一样的数据,本地和交上返回的值不一样,我也是醉了,先放上下次慢慢改,溜了溜了
//这代码有点问题
#include <iostream>
#include <cstdio>
#include <algorithm>
#define ll long long
using namespace std;
const ll mod=998244353;
const int maxn=1e5+5;
ll a[maxn],b[maxn];
int n;
ll pow(ll a,ll b)
{
ll res=1;
while(b)
{
if(b&1)
res=(a%mod)*(res%mod);
a=(a*a)%mod;
b=b/2;
}
return res%mod;
}
ll solve(ll a)
{
ll res=0;
ll ans=0;
while(a)
{
ll temp=a%10;
a/=10;
res+=temp*pow(10,ans*2);
res%=mod;
res+=temp*pow(10,ans*2+1);
ans++;
res%=mod;
}
return res;
}
int main()
{
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i];
}
ll ans=0;
for(int i=0;i<n;i++)
{
ll temp;
temp=(n*(solve(a[i])%mod))%mod;
ans+=temp%mod;
}
ans%=mod;
cout<<ans<<endl;
return 0;
}