#include using namespace std; const int mod=998244353; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N; string S; cin>>N>>S; int AB=0,CD=0; vectorinv(N+1),fac(N+1),invf(N+1); fac[0]=inv[0]=invf[0]=1; fac[1]=inv[1]=invf[1]=1; for(int i=2;i<=N;i++){ fac[i]=fac[i-1]*i%mod; inv[i]=inv[mod%i]*(mod-mod/i)%mod; invf[i]=invf[i-1]*inv[i]%mod; } for(int i=0;i<=N;i++){ switch(S[i]){ case 'A':++AB;break; case 'B':++AB;break; case 'C':++CD;break; case 'D':++CD;break; } } cout<