#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e18 + 1;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  ll n;
  cin >> n;
  ll ac = 0, wa = 0, tle = 0, re = 0;
  for (int i = 0; i < n; ++i) {
    string str;
    cin >> str;
    if (str == "AC") {
      ac++;
    } else if (str == "WA") {
      wa++;
    } else if (str == "TLE") {
      tle++;
    } else if (str == "RE") {
      re++;
    }
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}
