#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> arr(4);
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC")
      arr[0]++;
    else if (s == "WA")
      arr[1]++;
    else if (s == "TLE")
      arr[2]++;
    else if (s == "CE")
      arr[3]++;
  }
  cout << "AC x " << arr[0] << "\n";
  cout << "WA x " << arr[1] << "\n";
  cout << "TLE x " << arr[2] << "\n";
  cout << "RE x " << arr[3];
  return 0;
}
