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