#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define int  long long
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define mod 998244353
// order_of_key and *find_by_order
#define N 100001
int32_t main() {
	fast;
	int a = 0, b = 0, c = 0, d = 0;
	int t; cin >> t;
	while (t--) {
		string s;
		cin >> s;
		if (s == "AC")
			a++;
		else if (s == "TLE") {
			b++;
		}
		else if (s == "WA")
			c++;
		else
			d++;
	}
	cout << "AC x " << a << "\n";
	cout << "WA x " << b << "\n";
	cout << "TLE x " << c << "\n";
	cout << "RE x " << d << "\n";


}









