#include <bits/stdc++.h>
using namespace std;

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