#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,-1,sizeof(x))
const int INF = 1e9 + 1;
const ll MOD = 1e9 + 7;
const double PI = 3.141592653589793;
const int MAX_N = 2e5;

int main(){
  int n;
  cin >> n;
  int a = 0 , w= 0 , t=0, r=0;
  rep(i, n){
    stirng s;
    cin >> s;
    if(s == "AC") a++;
    if(s == "WA") w++;
    if(s == "TLE") t++;
    if(s == "RE") r++;
  }
  cout <<" AC x "<< a <<endl;
  cout <<"WA x "<< w << endl;
  cout << "TLE x "<<t<<endl;
  cout << "RE x " << r << endl;
}
