using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static List B=new List(); static List C=new List(); static int mx(int i,int j,int[] ar){ int max=ar[i]; for(int k=i+1;k<=j;k++){ if(ar[k]>max)max=ar[k]; } return max; } static long solve(int[] A) { // Return the sum of S(S(A)) modulo 10^9+7. long md=1000000007; long sum=0; for(int k=0;k