1 #define mm(a) memset(a,0,sizeof(a)); 2 #define max(x,y) (x)>(y)?(x):(y) 3 #define min(x,y) (x)<(y)?(x):(y) 4 #define Fopen freopen("1.in","r",stdin); freopen("m.out","w",stdout); 5 #define rep(i,a,b) for(int i=(a);i<=(b);i++) 6 #define per(i,b,a) for(int i=(b);i>=(a);i--) 7 #include<bits/stdc++.h> 8 typedef long long ll; 9 #define PII pair<ll,ll> 10 using namespace std; 11 const int INF=0x3f3f3f3f; 12 const int MAXN=(int)2e5 + 5; 13 const ll mod=10000019; 14 15 ll qpow(ll x,ll y,ll mod) { 16 ll ans=1; 17 while(y) { 18 if(y&1)ans=(x*ans)%mod; 19 x=(x*x)%mod; 20 y>>=1; 21 } 22 return ans; 23 } 24 int phi(int n) { 25 int rea = n; 26 for(int i=2; i*i<=n; i++) { 27 if(n % i == 0) { 28 rea = rea - rea / i; 29 while(n % i == 0) n /= i; 30 } 31 } 32 if(n > 1) 33 rea = rea - rea / n; 34 return rea; 35 } 36 37 ll gao(ll x,ll i) { 38 ll p=phi(mod); 39 return qpow(x,qpow(i,i,p),mod); 40 } 41 42 int main() { 43 int n; 44 scanf("%d",&n); 45 ll ans=0; 46 for(int i=1; i<=n; i++) { 47 ll x; 48 scanf("%lld",&x); 49 ans+=gao(x,(ll)i); 50 ans%=mod; 51 } 52 printf("%lld ",ans); 53 return 0; 54 }