#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) v.begin(),v.end()

int main() {
  int n;
  cin >> n;
  vector<int> a[n];
  for(int i=0;i<n;i++){
  	cin >> a[i];
  }
  int ac=0,wa=0,tle=0,re=0;
  for(int i=0;i<n;i++){
    if(a[i]=="AC")ac++;
    if(a[i]=="WA")wa++;
    if(a[i]=="TLE")tle++;
    if(a[i]=="RE")re++;
  }
  
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}

