#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
  int n;
  cin >> n;
  string s[n];
  rep(i,n)cin >> s[i];

  int ac=0,wa=0,lte=0,re=0;

  rep(i,n){
    if(s[i]=='AC')ac++;
    else if(s[i]=='WA')wa++;
    else if(s[i]=='LTE')lte++;
    else re++;
  }
  
  cout << "AC x " << ac  << endl;
  cout << "WA x " << wa  << endl;
  cout << "LTE x " << lte  << endl;
  cout << "RE x " << re  << endl;
}