#include <iostream>
#include <string>
#include <vector>
typedef long long ll;

int main(void)
{
  ll n;
  cin >> n;
  vector<ll> a(4, 0);
  string s;
  
  for (int i=0;i<n;i++){
    cin >> s;
    if (s == "AC"){
      a[0]++;
    }else if (s == "WA"){
      a[1]++;
    }else if (s == "TLE"){
      a[2]++;
    }else {
      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;
}