#include #include #include #include #include using namespace std; typedef long long ll; ll sumofdigits(ll x){ ll ans=0; while(x){ ans+=(x%10); x/=10; } return ans; } int main(){ int n; cin>>n; vectorp(n); for(int i=0;i>p[i]; while(p[i]>10){ p[i]=sumofdigits(p[i]); } } ll tmp=1; for(int i=0;i1e9){ tmp=sumofdigits(tmp); } } while(tmp>=10){ tmp=sumofdigits(tmp); } cout<