stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define rep(i,a,b) for(int i=(a);i<=(b);i++)

#define per(i,a,b) for(int i=(a);i>=(b);i--)

#define REP(i,n) for(int i=(0);i<(n);i++)

#define fi first

#define se second

#define pb push_back

#define mp make_pair

using namespace std;

typedef pair<int,int> pii;

typedef vector<int> vi;

typedef long long ll;



template<class T> inline void read(T &x){

	int f=0;x=0;char ch=getchar();

	for(;!isdigit(ch);ch=getchar())f|=(ch=='-');

	for(;isdigit(ch);ch=getchar())x=x*10+ch-'0';

	if(f)x=-x;

}



/*

    for(int j=0;j<=K;j++)

        f[1][j]=1,s[1][j]=K-j+1;

    for(int i=2;i<=n+1;i++)

    {

        for(int j=0;j<=K;j++)

            for(int k=1;k<i;k++)

                f[i][j]=(f[i][j]+f[i-k][j]*s[k][j+1]%mod*C[i-2][k-1])%mod;  

        for(int j=K;j>=0;j--)

            s[i][j]=(f[i][j]+s[i][j+1])%mod;

    }

*/

const int N=305;

int C[N][N],f[N][N],g[N][N],n,K,mod;



int fix(int x){

	return x>=mod?x-mod:x;

}



int main(){

	read(n),read(K),read(mod);

	C[0][0]=1;

	rep(i,1,n){

		C[i][0]=1;

		rep(j,1,n)C[i][j]=fix(C[i-1][j-1]+C[i-1][j]);

	}

	rep(i,0,K)f[1][i]=1,g[1][i]=K-i+1;

	rep(i,2,n+1)per(j,K,0){

		rep(k,1,i-1)

			f[i][j]=(f[i][j]+(ll)f[i-k][j]*g[k][j+1]%mod*C[i-2][k-1])%mod;

		g[i][j]=fix(g[i][j+1]+f[i][j]);

	}

	cout<<f[n+1][0]<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

#define N 305

int n,m,p,dp[N][N],su[N][N],c[N][N];

int main()

{

	scanf("%d%d%d",&n,&m,&p);n++;m++;

	for(int i=1;i<=m;i++)dp[1][i]=1,su[1][i]=i;

	for(int i=0;i<=n;i++)c[i][i]=c[i][0]=1;

	for(int i=2;i<=n;i++)for(int j=1;j<i;j++)c[i][j]=(c[i-1][j-1]+c[i-1][j])%p;

	for(int i=2;i<=n;i++)

	{

		for(int k=1;k<=m;k++)

		for(int j=1;j<i;j++)

		dp[i][k]=(dp[i][k]+1ll*dp[i-j][k]*su[j][k-1]%p*c[i-2][j-1])%p;

		for(int k=1;k<=m;k++)su[i][k]=(su[i][k-1]+dp[i][k])%p;

	}

	printf("%d\n",dp[n][m]);

}//

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



#define int long long



using namespace std;



const int N = 305;

int dp[N][N], pref[N][N], C[N][N], n, k, m;



signed main(){

    scanf("%lld %lld %lld", &n, &k, &m);



    for (int i = 0; i < N; i++) {

        for (int j = 0; j <= i; j++) {

            if (i == 0 || j == 0 || i == j) C[i][j] = 1;

            else C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % m;

        }

    }



    memset(dp, 0, sizeof(dp));



    for (int i = 1; i <= k + 1; i++) {

        dp[1][i] = 1;

        if (i == 1) pref[1][i] = dp[1][i];

        else pref[1][i] = (pref[1][i - 1] + dp[1][i]) % m;

    }



    for (int i = 2; i <= n + 1; i++) {

        for (int j = 1; j <= k + 1; j++) {

            for (int p = 1; p <= i - 1; p++) {

                int res = C[i - 2][p - 1];

                res *= dp[p][j]; res %= m;

                res *= pref[i - p][j - 1]; res %= m;



                dp[i][j] = (dp[i][j] + res) % m;

            }



            if (j == 1) pref[i][j] = dp[i][j];

            else pref[i][j] = (pref[i][j - 1] + dp[i][j]) % m;

        }

    }



    printf("%lld", dp[n + 1][k + 1]);

    return 0;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



const int N = 305;



int n, K, mod;

int f[N][N], c[N][N], prf[N][N];



int main() {

	ios_base::sync_with_stdio(false);

	cin >> n >> K >> mod; n++, K++;

	for (int i = 0;i <= n;++i){

		c[i][0] = 1;

		for (int j = 1;j <= i;++j) c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mod;

	}

	for (int i = 1;i <= n;++i) {

		for (int j = 1;j <= K;++j) {

			if (i == 1) f[i][j] = 1;

			else for (int k = 1;k < i;++k) {

				int cur = 1LL * c[i - 2][k - 1] * f[k][j] % mod;

				cur = 1LL * cur * prf[i - k][j - 1] % mod;

				f[i][j] = (f[i][j] + cur) % mod;

			} 

			prf[i][j] = (prf[i][j - 1] + f[i][j]) % mod;

		}

	}

	cout << f[n][K] << '\n';

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



using namespace std;



#define fi first

#define se second

#define pb push_back

#define mp make_pair



typedef pair<int,int> ii;



long long n,k,mod,c[305][305],f[305][305],g[305][305],h[305][305];



int main(){

    cin.tie(0),cout.tie(0),ios::sync_with_stdio(0);

    cin >> n >> k >> mod;

    c[0][0] = 1;

    for(int i = 1;i<=300;i++){

        c[i][0] = 1;

        for(int j = 1;j<=i;j++){

            c[i][j] = c[i-1][j-1] + c[i-1][j];

            c[i][j]%=mod;

        }

    }

    for(int i = 0;i<=302;i++)

        h[0][i] = 1;

    for(int i = 1;i<=n;i++){

        for(int j = k;j>=0;j--){

            f[i][j] = h[i-1][j+1]%mod;

            g[i][j] = g[i][j+1]+f[i][j];

            g[i][j]%=mod;

        }

        for(int j = 0;j<=k;j++){

            for(int l =1;l<=i;l++){

                h[i][j] += ((h[i-l][j]*g[l][j]%mod)*c[i-1][l-1])%mod;

                h[i][j]%=mod;

            }

        }

    }

    cout<<h[n][1]%mod;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

#include <vector>

#define file(x) freopen(#x".in", "r", stdin), freopen(#x".out", "w", stdout)



inline int read()

{

	int data = 0, w = 1; char ch = getchar();

	while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();

	if (ch == '-') w = -1, ch = getchar();

	while (ch >= '0' && ch <= '9') data = data * 10 + (ch ^ 48), ch = getchar();

	return data * w;

}



const int N(305);

int n, K, M, C[N][N], f[N][N], s[N][N];



int main()

{

	n = read(), K = read(), M = read();

	for (int i = 0; i <= n; i++) C[i][0] = 1;

	for (int i = 1; i <= n; i++)

		for (int j = 1; j <= i; j++) C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % M;

	for (int i = K; ~i; i--) f[1][i] = 1, s[1][i] = (f[1][i] + s[1][i + 1]) % M;

	for (int i = 2; i <= n + 1; i++)

	{

		for (int j = K; ~j; j--)

		{

			for (int k = 1; k < i; k++)

				f[i][j] = (f[i][j] + 1ll * f[i - k][j] * C[i - 2][k - 1] % M * s[k][j + 1]) % M;

			s[i][j] = (f[i][j] + s[i][j + 1]) % M;

		}

	}

	printf("%d\n", f[n + 1][0]);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int n,k,m;

int dp[305][305];

int sum[305][305];

int C[305][305];



int main()

{

	scanf("%d%d%d",&n,&k,&m);

	for(int i = 0;i <= k; ++ i) dp[1][i] = 1,sum[1][i] = k - i + 1;

	C[0][0] = 1;

	for(int i = 1;i <= 300; ++ i)

	{

		C[i][0] = 1;

		for(int j = 1;j <= i; ++ j)

			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % m;

	}

	for(int i = 2;i <= n + 1; ++ i)

		for(int j = k - 1;j >= 0; -- j)

		{

			for(int l = 1;l < i; ++ l)

				dp[i][j] = (dp[i][j] + dp[l][j] * 1ll * sum[i - l][j + 1] % m * C[i - 2][l - 1] % m) % m;

			sum[i][j] = sum[i][j + 1] + dp[i][j],sum[i][j] %= m;

		}

	printf("%d\n",dp[n + 1][0]);

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

#include <vector>

#define file(x) freopen(#x".in", "r", stdin), freopen(#x".out", "w", stdout)



inline int read()

{

	int data = 0, w = 1; char ch = getchar();

	while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();

	if (ch == '-') w = -1, ch = getchar();

	while (ch >= '0' && ch <= '9') data = data * 10 + (ch ^ 48), ch = getchar();

	return data * w;

}



const int N(305);

int n, K, M, C[N][N], f[N][N], s[N][N];



int main()

{

	n = read(), K = read(), M = read();

	for (int i = 0; i <= n; i++) C[i][0] = 1;

	for (int i = 1; i <= n; i++)

		for (int j = 1; j <= i; j++) C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % M;

	for (int i = K; ~i; i--) f[1][i] = 1, s[1][i] = (f[1][i] + s[1][i + 1]) % M;

	for (int i = 2; i <= n + 1; i++)

	{

		for (int j = K; ~j; j--)

		{

			for (int k = 1; k < i; k++)

				f[i][j] = (f[i][j] + 1ll * f[i - k][j] * C[i - 2][k - 1] % M * s[k][j + 1]) % M;

			s[i][j] = (f[i][j] + s[i][j + 1]) % M;

		}

	}

	printf("%d\n", f[n + 1][0]);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
//I love Nnanami Chiaki

#include<bits/stdc++.h>

using namespace std;

const int maxn=307;

int n,k,m;

int dp[maxn][maxn],sum[maxn][maxn],c[maxn][maxn];

void init(){

	c[0][0]=1;

	for (int i=1;i<=n;i++){

		c[i][0]=1;

		for (int j=1;j<=i;j++) c[i][j]=(c[i-1][j-1]+c[i-1][j])%m;

	}

}

int main(){

	scanf("%d%d%d",&n,&k,&m);

	init();

	for (int i=k;i>=0;i--) dp[1][i]=1;

	for (int i=k;i>=0;i--) sum[1][i]=(sum[1][i+1]+dp[1][i])%m;

	for (int i=2;i<=n+1;i++){

		for (int j=0;j<=k;j++){

			for (int sz=1;sz<i;sz++) dp[i][j]=(dp[i][j]+1ll*dp[i-sz][j]*c[i-2][sz-1]%m*sum[sz][j+1]%m)%m;

		}

		for (int j=k;j>=0;j--) sum[i][j]=(sum[i][j+1]+dp[i][j])%m;

	}

	printf("%d\n",dp[n+1][0]);

	return 0;

} 

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

#include <vector>

#define file(x) freopen(#x".in", "r", stdin), freopen(#x".out", "w", stdout)



inline int read()

{

	int data = 0, w = 1; char ch = getchar();

	while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();

	if (ch == '-') w = -1, ch = getchar();

	while (ch >= '0' && ch <= '9') data = data * 10 + (ch ^ 48), ch = getchar();

	return data * w;

}



const int N(305);

int n, K, M, C[N][N], f[N][N], s[N][N];



int main()

{

	n = read(), K = read(), M = read();

	for (int i = 0; i <= n; i++) C[i][0] = 1;

	for (int i = 1; i <= n; i++)

		for (int j = 1; j <= i; j++) C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % M;

	for (int i = K; ~i; i--) f[1][i] = 1, s[1][i] = (f[1][i] + s[1][i + 1]) % M;

	for (int i = 2; i <= n + 1; i++)

	{

		for (int j = K; ~j; j--)

		{

			for (int k = 1; k < i; k++)

				f[i][j] = (f[i][j] + 1ll * f[i - k][j] * C[i - 2][k - 1] % M * s[k][j + 1]) % M;

			s[i][j] = (f[i][j] + s[i][j + 1]) % M;

		}

	}

	printf("%d\n", f[n + 1][0]);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



using namespace std;



#define int long long



const int N = 305;

int n, mod, K, dp[N][N], C[N][N], psum[N][N];



void sieve(){

    for(int i = 0; i < N; ++i) C[0][i] = C[i][i] = 1;

    for(int i = 1; i < N; ++i){

        for(int j = 1; j < i; ++j){

            C[j][i] = (C[j][i - 1] + C[j - 1][i - 1]) % mod;

        }

    }

}



signed main(){

    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    cin >> n >> K >> mod;

    sieve();



    for(int i = 0; i <= K; ++i) dp[1][i] = 1, psum[1][i] = (i + 1) % mod;



    for(int i = 2; i <= n + 1; ++i){

        for(int j = 0; j <= K; ++j){

            for(int k = 1; k < i; ++k){

                dp[i][j] += ((dp[i - k][j] * (psum[k][K] - psum[k][j])) % mod * C[k - 1][i - 2]) % mod; dp[i][j] %= mod;

            }

            if(j) psum[i][j] = (dp[i][j] + psum[i][j - 1]) % mod;

        }

    }



     cout << (dp[n + 1][0] + mod) % mod;



    return 0;

}


// Optimized solution to the same problem (faster):
#include <iostream>

#include <cstdio>

#define ll long long

using namespace std;

inline int read()

{

	int x = 0, f = 1; char ch = getchar();

	while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}

	while(ch >= '0' && ch <= '9') {x = (x << 3) + (x << 1) + (ch ^ 48); ch = getchar();}

	return x * f;

}

const int N = 310;

int n,k,mod;

ll C[N][N],f[N][N],sf[N][N];

int main()

{

	n = read(); k = read(); mod = read();

	for(int i = 0;i <= n;i ++)

	{

		C[i][0] = 1;

		for(int j = 1;j <= i;j ++) C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % mod;

	}

	for(int j = 0;j <= k;j ++) f[1][j] = 1,sf[1][j] = k - j + 1;

	for(int i = 2;i <= n + 1;i ++)

	{

		for(int j = 0;j <= k;j ++) 

			for(int siz = 1;siz <= i - 1;siz ++) 

				f[i][j] = (f[i][j] + f[i - siz][j] * sf[siz][j + 1] % mod * C[i - 2][siz - 1] % mod) % mod;

		sf[i][k] = f[i][k];

		for(int j = k - 1;j >= 1;j --) sf[i][j] = (sf[i][j + 1] + f[i][j]) % mod;

	}

	cout << f[n + 1][0] << "\n"; return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <algorithm>

#include <cstring>

#include <string>

#include <cmath>

#include <set>

#include <unordered_set>

#include <vector>

#include<valarray>

#include<map>

#include <bits/stdc++.h>

#include <utility>

#include<bits/stdc++.h>

int a[4];

using namespace std;



int main()

{

int t;

cin>>t;

string s;

while (t--)

{

    cin>>s;

    if(s=="AC")

    {

        a[0]++;

    }

    if(s=="WA")

    {

        a[1]++;

    }

    if(s=="TLE")

    {

        a[2]++;

    }

    if(s=="RE")

    {

        a[3]++;

    }



}

cout<<"AC x "<<a[0]<<endl;

    cout<<"WA x "<<a[1]<<endl;

    cout<<"TLE x "<<a[2]<<endl;

    cout<<"RE x "<<a[3]<<endl;





    return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main() {

 

    int t, AC=0, WA=0, TLE=0, RE=0;

    char str[105];

 

    scanf("%d", &t);

    while(t--) {

        scanf("%s", str);

        if(str[0] == 'A') {

            AC++;

        } else if(str[0] == 'W') {

            WA++;

        } else if(str[0] == 'T') {

            TLE++;

        } else if(str[0] == 'R') {

            RE++;

        }

    }

 

    printf("AC x %d\n", AC);

    printf("WA x %d\n", WA);

    printf("TLE x %d\n", TLE);

    printf("RE x %d\n", RE);

 

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

	int t, wa=0 ,tle=0, ac=0 ,re=0; cin>>t;



	for(int i=0; i< t;++i)

	{

		string s; cin>>s;

		if(s == "AC") ac++;

		else if(s == "RE") re++;

		else if(s == "TLE") tle++;

		else wa++;



	}

	cout<<"AC x "<<ac<<endl;

	cout<<"WA x "<<wa<<endl;

	cout<<"TLE x "<<tle<<endl;

	cout<<"RE x "<<re<<endl;









}

// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main() {

 

    int t, AC=0, WA=0, TLE=0, RE=0;

    char str[105];

 

    scanf("%d", &t);

    while(t--) {

        scanf("%s", str);

        if(str[0] == 'A') {

            AC++;

        } else if(str[0] == 'W') {

            WA++;

        } else if(str[0] == 'T') {

            TLE++;

        } else if(str[0] == 'R') {

            RE++;

        }

    }

 

    printf("AC x %d\n", AC);

    printf("WA x %d\n", WA);

    printf("TLE x %d\n", TLE);

    printf("RE x %d\n", RE);

 

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cmath>

#include <algorithm>

#include <cstdlib>

using namespace std;



int main() {

    int x, a=0,b=0,c=0,d=0;

    scanf("%d",&x);

    string s;

    for (int i = 0; i < x; i++) {

        cin>>s;

        if(s=="AC")

            a++;

        else if (s=="WA")

        b++;

        else if(s=="TLE")

            c++;

        else if(s=="RE")

            d++;

    }

    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n",a,b,c,d);



}

// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main() {

 

    int t, AC=0, WA=0, TLE=0, RE=0;

    char str[105];

 

    scanf("%d", &t);

    while(t--) {

        scanf("%s", str);

        if(str[0] == 'A') {

            AC++;

        } else if(str[0] == 'W') {

            WA++;

        } else if(str[0] == 'T') {

            TLE++;

        } else if(str[0] == 'R') {

            RE++;

        }

    }

 

    printf("AC x %d\n", AC);

    printf("WA x %d\n", WA);

    printf("TLE x %d\n", TLE);

    printf("RE x %d\n", RE);

 

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

/*  Writen by : AS7

 *  "JUST KEEP GOING..."

 */

#define endl			'\n'

#define ll				long long

#define all(v)			((v).begin()), ((v).end())

#define allr(v)			((v).rbegin()), ((v).rend())

#define sz(v)			((int)((v).size()))

#define clr(v, d)		memset(v, d, sizeof(v))

#define rep(i, v)		for(int i=0;i<sz(v);++i)

#define For(i,s)        for(auto i:s)

#define Forr(i,s)        for(auto &i:s)

#define lp(i, n)		for(int i=0;i<(int)(n);++i)

#define lpi(i, j, n)	for(int i=(j);i<(int)(n);++i)

#define lpd(i, j, n)	for(int i=(j);i>=(int)(n);--i)

#define vi				vector <int>

#define vl				vector <ll>

#define ii				pair <int,int>

#define vii				vector <ii>

#define vll				vector <pair<ll,ll>>

#define PI				double PPPPPP = 3.14159265358979323846;

#define bit(mask,i) ((mask>>i)&1)

const int N = 2e5+5;

map<string ,int > freq;

void solve(){

   int n;

   cin>>n;

   lp(i,n){

       string s;

       cin>>s;

       freq[s]++;

   }

   cout<<"AC x "<<freq["AC"]<<"\n"<<"WA x "<<freq["WA"]<<"\n"<<"TLE x "<<freq["TLE"]<<"\n"<<"RE x "<<freq["RE"]<<endl;



}

int main() {

    int t = 1;

  //  cin>>t;

    while (t--)solve();

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main() {

 

    int t, AC=0, WA=0, TLE=0, RE=0;

    char str[105];

 

    scanf("%d", &t);

    while(t--) {

        scanf("%s", str);

        if(str[0] == 'A') {

            AC++;

        } else if(str[0] == 'W') {

            WA++;

        } else if(str[0] == 'T') {

            TLE++;

        } else if(str[0] == 'R') {

            RE++;

        }

    }

 

    printf("AC x %d\n", AC);

    printf("WA x %d\n", WA);

    printf("TLE x %d\n", TLE);

    printf("RE x %d\n", RE);

 

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
# include <iostream>

using namespace std;

//AC, WA, TLE, or RE.

int main()

{

    string a[] = {"AC", "WA", "TLE", "RE"};

    int res[] = {0,0,0,0};

    int x;

    cin >> x;

    string n;

    for(int i = 0; i < x; i++)

    {

        cin >> n;

        for (int j = 0; j < 4; j++)

        {

            if (a[j] == n)

            {

                res[j]++;

            }

        }

    }

    for (int i = 0; i < 4; i++)

    {

        cout << a[i] << " x " << res[i] << endl; 

    }

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main() {

 

    int t, AC=0, WA=0, TLE=0, RE=0;

    char str[105];

 

    scanf("%d", &t);

    while(t--) {

        scanf("%s", str);

        if(str[0] == 'A') {

            AC++;

        } else if(str[0] == 'W') {

            WA++;

        } else if(str[0] == 'T') {

            TLE++;

        } else if(str[0] == 'R') {

            RE++;

        }

    }

 

    printf("AC x %d\n", AC);

    printf("WA x %d\n", WA);

    printf("TLE x %d\n", TLE);

    printf("RE x %d\n", RE);

 

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

int main() {

    string AC , WA, TLE, RE;

    string x;

    int n;

    cin>>n;

    int cnt1=0;

    int cnt2=0;

    int cnt3=0;

    int cnt4=0;

    for (int i = 0; i <n ; ++i) {

        cin>>x;

        if(x== "AC"){++cnt1;}

        if(x== "WA"){++cnt2;}

        if(x== "TLE"){++cnt3;}

        if(x== "RE"){++cnt4;}

    }

    cout<<"AC"<<" "<<"x"<<" "<<cnt1<<endl;

    cout<<"WA"<<" "<<"x"<<" "<< cnt2<<endl;

    cout<<"TLE"<<" "<<"x"<<" "<< cnt3<<endl;

    cout<<"RE"<<" "<<"x"<<" "<< cnt4<<endl;



    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main() {

 

    int t, AC=0, WA=0, TLE=0, RE=0;

    char str[105];

 

    scanf("%d", &t);

    while(t--) {

        scanf("%s", str);

        if(str[0] == 'A') {

            AC++;

        } else if(str[0] == 'W') {

            WA++;

        } else if(str[0] == 'T') {

            TLE++;

        } else if(str[0] == 'R') {

            RE++;

        }

    }

 

    printf("AC x %d\n", AC);

    printf("WA x %d\n", WA);

    printf("TLE x %d\n", TLE);

    printf("RE x %d\n", RE);

 

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include<bits/stdc++.h>



using namespace std;



int main()

{

    int n;

    cin>>n;

    map<string,int>tmp;





    tmp["AC"]=0;

    tmp["WA"]=0;

    tmp["TLE"]=0;

    tmp["RE"]=0;



    for(int i = 0 ; i  < n ;i++)

    {

        string s;cin>>s;



        tmp[s]++;

    }



    cout<<"AC x " << tmp["AC"]<<endl;

    cout<<"WA x " << tmp["WA"]<<endl;

    cout<<"TLE x " << tmp["TLE"]<<endl;

    cout<<"RE x " << tmp["RE"]<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main() {

 

    int t, AC=0, WA=0, TLE=0, RE=0;

    char str[105];

 

    scanf("%d", &t);

    while(t--) {

        scanf("%s", str);

        if(str[0] == 'A') {

            AC++;

        } else if(str[0] == 'W') {

            WA++;

        } else if(str[0] == 'T') {

            TLE++;

        } else if(str[0] == 'R') {

            RE++;

        }

    }

 

    printf("AC x %d\n", AC);

    printf("WA x %d\n", WA);

    printf("TLE x %d\n", TLE);

    printf("RE x %d\n", RE);

 

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main()

{



    int n;

    cin>>n;

    int a[4]={0};

    for(int i=0 ; i<n ; i++){

        string s;

        cin>>s;

        if(s=="AC")

            a[0]+=1;

        else if(s=="WA")

            a[1]+=1;

        else if(s=="TLE")

            a[2]+=1;

        else

            a[3]+=1;

    }





     cout<<"AC x "<<a[0]<<endl;

     cout<<"WA x "<<a[1]<<endl;

     cout<<"TLE x "<<a[2]<<endl;

     cout<<"RE x "<<a[3]<<endl;















}


// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main() {

 

    int t, AC=0, WA=0, TLE=0, RE=0;

    char str[105];

 

    scanf("%d", &t);

    while(t--) {

        scanf("%s", str);

        if(str[0] == 'A') {

            AC++;

        } else if(str[0] == 'W') {

            WA++;

        } else if(str[0] == 'T') {

            TLE++;

        } else if(str[0] == 'R') {

            RE++;

        }

    }

 

    printf("AC x %d\n", AC);

    printf("WA x %d\n", WA);

    printf("TLE x %d\n", TLE);

    printf("RE x %d\n", RE);

 

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

void init(){

    cin.tie(0);

    cin.sync_with_stdio(0);

}

int fr[205];

int main()

{   init();

    int n;

    cin>>n;

    map<string ,int>mp;

    for(int i=0;i<n;i++){

        string s;

        cin>>s;

        mp[s]++;}

        cout<<"AC x "<<mp["AC"]<<endl<<"WA x "<<mp["WA"]<<endl<<"TLE x "<<mp["TLE"]<<endl<<"RE x "<<mp["RE"];



}


// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main() {

 

    int t, AC=0, WA=0, TLE=0, RE=0;

    char str[105];

 

    scanf("%d", &t);

    while(t--) {

        scanf("%s", str);

        if(str[0] == 'A') {

            AC++;

        } else if(str[0] == 'W') {

            WA++;

        } else if(str[0] == 'T') {

            TLE++;

        } else if(str[0] == 'R') {

            RE++;

        }

    }

 

    printf("AC x %d\n", AC);

    printf("WA x %d\n", WA);

    printf("TLE x %d\n", TLE);

    printf("RE x %d\n", RE);

 

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include<bits/stdc++.h>

using namespace std;



int main() {

int n;

cin>>n;

int AC=0,WA=0,TLE=0,RE=0;

while(n--){

	string s;

	cin>>s;

	if(s=="AC")AC++;

	else if(s=="WA")WA++;

	else if(s=="TLE")TLE++;

	else

	RE++;

}cout<<"AC x "<<AC<<endl;

cout<<"WA x "<<WA<<endl;

cout<<"TLE x "<<TLE<<endl;

cout<<"RE x "<<RE<<endl;



	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main() {

 

    int t, AC=0, WA=0, TLE=0, RE=0;

    char str[105];

 

    scanf("%d", &t);

    while(t--) {

        scanf("%s", str);

        if(str[0] == 'A') {

            AC++;

        } else if(str[0] == 'W') {

            WA++;

        } else if(str[0] == 'T') {

            TLE++;

        } else if(str[0] == 'R') {

            RE++;

        }

    }

 

    printf("AC x %d\n", AC);

    printf("WA x %d\n", WA);

    printf("TLE x %d\n", TLE);

    printf("RE x %d\n", RE);

 

    return 0;

}

// Fastest known solution for this problem: