#include <iostream>
#include <vector>

using namespace std;

int main() {
  vector<int> nums(4, 0);
  int n; cin >> n;
  for (int i = 0; i < n; i++) {
    string s; cin >> s;
    if (s == "AC") num[0]++;
    if (s == "WA") num[1]++;
    if (s == "TLE") num[2]++;
    if (s == "RE") num[3]++;
  }
  cout << "AC x " << num[0] << endl;
  cout << "WA x " << num[1] << endl;
  cout << "TLE x " << num[2] << endl;
  cout << "RE x " << num[3] << endl;
}