#include <bits/stdc++.h>
using namespace std;
int ac = 0, wa = 0, tle = 0, re = 0;
string s;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    if (s == "AC")
      ++ac;
    else if (s == "WA")
      ++wa;
    else if (s == "TLE")
      ++tle;
    else if (s == "re")
      ++re;
  }
  cout << "AC x " << ac << '\n';
  cout << "WA x " << wa << '\n';
  cout << "TLE x " << tle << '\n';
  cout << "RE x " << re << '\n';
  return 0;
}
