#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const int MX = 300 + 10;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int ac = 0, wa = 0, tle = 0, re = 0;
  vector<string> s(n);
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == "AC")
      ac++;
    else if (s[i] == "WA")
      wa++;
    else if (s[i] == "TLE")
      tle++;
    else
      re++;
  }
  cout << "AC x " << ac << '\n';
  cout << "WA x " << wa << '\n';
  cout << "TLE x " << tle << '\n';
  cout << "Re x " << re << '\n';
  return 0;
}
