#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, ac = 0, rt = 0, tl = 0, wa = 0;
  while (n--) {
    string a;
    cin >> a;
    if (a == "AC")
      ac++;
    else if (a == "RE")
      rt++;
    else if (a == "TLE")
      tl++;
    else if (a == "WA")
      wa++;
  }
  cout << "AC x " << ac << "\n";
  cout << "WA x " << wa << "\n";
  cout << "TLE x " << tl << "\n";
  cout << "RE x " << rt << "\n";
  return 0;
}
