#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, a = 0, b = 0, c = 0, d = 0;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    if (s == "AC") a++;
    if (s == "TLE") b++;
    if (s == "WA") c++;
    if (s == "RE") d++;
  }
  cout << "AC x " << a << endl;
  cout << "TLE x " << b << endl;
  cout << "WA x " << c << endl;
  cout << "RE x " << d << endl;
}
