x#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, a, b) for (int i = a; i < b; i++)
typedef long long ll;
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> x(4);
  rep(i, n){
    string s;
    cin >> s;
    if(s == "AC") x.at(0)++;
    else if(s == "WA") x.at(1)++;
    else if(s == "TLE") x.at(2)++;
    else if(s == "RE") x.at(3)++;
  } 
  cout << "AC x " << x.at(0) << endl;
  cout << "WA x " << x.at(1) << endl;
  cout << "TLE x " << x.at(2) << endl;
  cout << "RE x " << x.at(3) << endl;
}