#include <bits/stdc++.h>
using namespace std;
int main() {
  int A = 0, W = 0, T = 0, R = 0, N;
  cin >> N;
  vector<string> vec(N);
  for(int i = 0; i < N; i++) {
    cin >> vec.at(i);
    if(vec.at(i) == "AC") {
      A += 1;
    }
    else if(vec.at(i) == "WA") {
      W += 1;
    }
    else if(vec.at(i) == "TLE") {
      T += 1;
    }
    else {
      R += 1;
    }
  }
  cout << "AC x " A << endl
       << "WA x " W << endl
       << "TLE x " T << endl
       << "RE x " R << endl;
  return 0;
}
