#include<iostream>
#include<string>
using namespace std;

int main(){
  int n;
  int a = 0, b = 0, c = 0, d = 0;
  string s[10000];
  cin >> n;
  for(int i = 0;i < n;i++){
    cin >> s;
  if(s[i] == 'AC'){
    a++;
  }
    else if(s[i] == 'WA'){
    b++;
    }
    else if(s[i] == 'TLE'){
      c++;
    }
    else{
      d++:
    }
  }
  cout << "AC * "<<a<<endl;
  cout << "WA * "<<b<<endl;
  cout << "TLE * "<<c<<endl;
  cout << "RE * "<<d<<endl;
}
    
  