#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> s(n);
  int a = 0, w = 0, t = 0, r = 0;
  for (int i = 0; i < n; i++) {
    cin >> s.at(i);
    if (s.at(i) == "AC")
      a++;
    else if (s.at(i) == "WA")
      w++;
    else if (s.at(i) == "TLE")
      t++;
    else
      r++;
  }
  cout << "AC x " << a;
  cout << "WA x " << w;
  cout << "TLE x " << t;
  cout << "RE x " << r;
}
