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

int main() {
  int N;
  cin >> N;
  
  vector <int> result(4, 0);
  for (int i = 0; i < N; i++) {
    string S;
    cin >> S;
    if (S == "AC") {
      result[0]++;
    }
    if (S == "WA") {
      result[1]++;
    }
    if (S == "TLE") {
      result[2]++;
    }
    if (S == "RE") {
      result[3]++;
    }
    
  }

  cout << "AC x " << result[0] << endl;
  cout << "WA x " << result[1] << endl;
  cout << "TLE x " << result[2] << endl;
  cout << "RE x " << result[3] << endl;
}