#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n;
  cin >> n;
  int a, w, t, r;
  for (ll i = 0; i < (ll)n; ++i) {
    string s;
    cin >> s;
    if (s == "AC") a++;
    if (s == "WA") w++;
    if (s == "TLE") t++;
    if (s == "R") r++;
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << w << endl;
  cout << "TLE x " << t << endl;
  cout << "RE x " << r << endl;
  return 0;
}
