import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int solve(int[] A) { // Return the sum of S(S(A)) modulo 10^9+7. // Brute force is easy int n = A.length; List B = new ArrayList(); for(int k=0;k C = new ArrayList(); for(int k=0;k