#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  int c0 = 0;
  int c1 = 0;  
  int c2 = 0;
  int c3 = 0;
  for (i = 0; i < n; i++){
    String S;
    cin >> S;
    if (S == "AC"){
      c0 += 1
    }else if (S == "WA"){
      c1 += 1
    }else if (S == "TLE"){
      c2 += 1
    }else if (S == "RE"){
      c3 += 1
    }
  }
  cout << "AC" << " " << "x" << " " << c0 << endl;
  cout << "WA" << " " << "x" << " " << c1 << endl;
  cout << "TLE" << " " << "x" << " " << c2 << endl;
  cout << "RE" << " " << "x" << " " << c3 << endl;
}