stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#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]);

}

// Faster C++ solution for the same problem (measured speedup: 1.2612252827025168x):
//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;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 7.316577785802743x):
#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;

}
// Slower C++ solution:
#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]);

}

// Faster C++ solution for the same problem (measured speedup: 6.5378245777639385x):
#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;

}
// Slower C++ solution:
//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;

} 

// Faster C++ solution for the same problem (measured speedup: 5.183708784964157x):
#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;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 1.4579927168384523x):
#include <bits/stdc++.h>

using namespace std;



const int N = 310;



typedef long long LL;



int dp[N][N], C[N][N], sum[N][N];



int main() {

    int n, k, mod; scanf("%d%d%d", &n, &k, &mod), n++;

    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] + C[i - 1][j - 1]) % mod;

    }

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

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

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

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

                dp[i][j] = (dp[i][j] + (LL)dp[i - t][j] * C[i - 2][t - 1] % mod * sum[t][j + 1]) % mod;

        }

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

    }

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

    return 0;

}//
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 1.4657866021109378x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.2518173055005x):
#include<stdio.h>

#include<string.h>



int main(){

    

	int input;

	int ACc = 0;

	int WAc = 0;

	int TLEc = 0;

	int REc = 0;

	char inputted[100];

	

	scanf("%d", &input);

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

		scanf("%s", inputted);

		if('A' == inputted[0])

		{

			ACc++;

		}

		else if('W' == inputted[0])



		{

			WAc++;

		}

		else if('T' == inputted[0])

		{

			TLEc++;

		}

		else if('R' == inputted[0])

		{

			REc++;

		}

	}

	

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

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

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

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

}
// Slower C++ solution:
#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;









}

// Faster C++ solution for the same problem (measured speedup: 5.249496775888514x):
#include<stdio.h>

#include<string.h>



int main(){

    

	int input;

	int ACc = 0;

	int WAc = 0;

	int TLEc = 0;

	int REc = 0;

	char inputted[100];

	

	scanf("%d", &input);

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

		scanf("%s", inputted);

		if('A' == inputted[0])

		{

			ACc++;

		}

		else if('W' == inputted[0])



		{

			WAc++;

		}

		else if('T' == inputted[0])

		{

			TLEc++;

		}

		else if('R' == inputted[0])

		{

			REc++;

		}

	}

	

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

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

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

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

}
// Slower C++ solution:
#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);



}

// Faster C++ solution for the same problem (measured speedup: 5.200614493627116x):
#include<stdio.h>

#include<string.h>



int main(){

    

	int input;

	int ACc = 0;

	int WAc = 0;

	int TLEc = 0;

	int REc = 0;

	char inputted[100];

	

	scanf("%d", &input);

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

		scanf("%s", inputted);

		if('A' == inputted[0])

		{

			ACc++;

		}

		else if('W' == inputted[0])



		{

			WAc++;

		}

		else if('T' == inputted[0])

		{

			TLEc++;

		}

		else if('R' == inputted[0])

		{

			REc++;

		}

	}

	

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

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

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

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

}
// Slower C++ solution:
#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();

}

// Faster C++ solution for the same problem (measured speedup: 5.265279274893657x):
#include<stdio.h>

#include<string.h>



int main(){

    

	int input;

	int ACc = 0;

	int WAc = 0;

	int TLEc = 0;

	int REc = 0;

	char inputted[100];

	

	scanf("%d", &input);

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

		scanf("%s", inputted);

		if('A' == inputted[0])

		{

			ACc++;

		}

		else if('W' == inputted[0])



		{

			WAc++;

		}

		else if('T' == inputted[0])

		{

			TLEc++;

		}

		else if('R' == inputted[0])

		{

			REc++;

		}

	}

	

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

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

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

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

}
// Slower C++ solution:
# 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; 

    }

}


// Faster C++ solution for the same problem (measured speedup: 5.2418846660562295x):
#include<stdio.h>

#include<string.h>



int main(){

    

	int input;

	int ACc = 0;

	int WAc = 0;

	int TLEc = 0;

	int REc = 0;

	char inputted[100];

	

	scanf("%d", &input);

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

		scanf("%s", inputted);

		if('A' == inputted[0])

		{

			ACc++;

		}

		else if('W' == inputted[0])



		{

			WAc++;

		}

		else if('T' == inputted[0])

		{

			TLEc++;

		}

		else if('R' == inputted[0])

		{

			REc++;

		}

	}

	

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

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

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

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

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.255472200006954x):
#include<stdio.h>

#include<string.h>



int main(){

    

	int input;

	int ACc = 0;

	int WAc = 0;

	int TLEc = 0;

	int REc = 0;

	char inputted[100];

	

	scanf("%d", &input);

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

		scanf("%s", inputted);

		if('A' == inputted[0])

		{

			ACc++;

		}

		else if('W' == inputted[0])



		{

			WAc++;

		}

		else if('T' == inputted[0])

		{

			TLEc++;

		}

		else if('R' == inputted[0])

		{

			REc++;

		}

	}

	

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

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

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

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

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.271711077884797x):
#include<stdio.h>

#include<string.h>



int main(){

    

	int input;

	int ACc = 0;

	int WAc = 0;

	int TLEc = 0;

	int REc = 0;

	char inputted[100];

	

	scanf("%d", &input);

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

		scanf("%s", inputted);

		if('A' == inputted[0])

		{

			ACc++;

		}

		else if('W' == inputted[0])



		{

			WAc++;

		}

		else if('T' == inputted[0])

		{

			TLEc++;

		}

		else if('R' == inputted[0])

		{

			REc++;

		}

	}

	

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

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

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

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

}
// Slower C++ solution:
#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;















}


// Faster C++ solution for the same problem (measured speedup: 5.249829039025465x):
#include<stdio.h>

#include<string.h>



int main(){

    

	int input;

	int ACc = 0;

	int WAc = 0;

	int TLEc = 0;

	int REc = 0;

	char inputted[100];

	

	scanf("%d", &input);

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

		scanf("%s", inputted);

		if('A' == inputted[0])

		{

			ACc++;

		}

		else if('W' == inputted[0])



		{

			WAc++;

		}

		else if('T' == inputted[0])

		{

			TLEc++;

		}

		else if('R' == inputted[0])

		{

			REc++;

		}

	}

	

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

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

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

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

}
// Slower C++ solution:
#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"];



}


// Faster C++ solution for the same problem (measured speedup: 5.336496111362241x):
#include<stdio.h>

#include<string.h>



int main(){

    

	int input;

	int ACc = 0;

	int WAc = 0;

	int TLEc = 0;

	int REc = 0;

	char inputted[100];

	

	scanf("%d", &input);

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

		scanf("%s", inputted);

		if('A' == inputted[0])

		{

			ACc++;

		}

		else if('W' == inputted[0])



		{

			WAc++;

		}

		else if('T' == inputted[0])

		{

			TLEc++;

		}

		else if('R' == inputted[0])

		{

			REc++;

		}

	}

	

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

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

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

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

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.24927462320974x):
#include<stdio.h>

#include<string.h>



int main(){

    

	int input;

	int ACc = 0;

	int WAc = 0;

	int TLEc = 0;

	int REc = 0;

	char inputted[100];

	

	scanf("%d", &input);

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

		scanf("%s", inputted);

		if('A' == inputted[0])

		{

			ACc++;

		}

		else if('W' == inputted[0])



		{

			WAc++;

		}

		else if('T' == inputted[0])

		{

			TLEc++;

		}

		else if('R' == inputted[0])

		{

			REc++;

		}

	}

	

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

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

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

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

}