#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  string x;
  int ACs = 0, WAs = 0, TLEs = 0, REs = 0;
  while(n--){
    cin >> x;
    if (x == 'AC')
      ACs++;
    else if (x == 'WA')
      WAs++;
    else if (x == 'TLE')
      TLEs++;
    else
      REs++;
  }
  cout << "AC x " << ACs << endl;
  cout << "WA x " << WAs << endl;
  cout << "TLE x " << TLEs << endl;
  cout << "RE x " << REs << endl;
}