q=1e6+3,s,c,i;long x;main(t){for(c=atoi(gets(&c));~scanf("%d",&t);s+=x)for(i=31,x=1;i--;x%=q)x*=t>>i&1?x*c:x;c=!printf("%d",s%q);}