#include using namespace std; #define ll long long int #define mod 998244353 ll dp[200005][2][2]; string s; int n; ll solve(int pos,bool used,bool small){ if(pos>=n){ return (ll)(used&&small); } if(dp[pos][used][small]!=-1) return dp[pos][used][small]; ll ans=0; char r=small?'z':s[pos]; char l='a'; if(used) l++; for(char c=l;c<=r;c++){ ans+=solve(pos+1,(c=='a')|used,small|(c>t; assert(1<=t&&t<=10); while(t--){ cin >> n >> s; assert(1<=n&&n<=200000); assert(s.size()==n); for(int i=0;i='a'&&s[i]<='z'); } memset(dp,-1,sizeof(dp)); cout<