#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;
  cin >> n;
  ll cnt_ac = 0;
  ll cnt_wa = 0;
  ll cnt_re = 0;
  ll cnt_tle = 0;
  for (ll _ = 0; _ < (ll)n; _++) {
    string s;
    cin >> s;
    if (s == "AC") {
      cnt_ac += 1;
    } else if (s == "WA") {
      cnt_wa += 1;
    } else if (s == "TLE") {
      cnt_tle += 1;
    } else if (s == "RE") {
      cnt_tle += 1;
    }
  }
  cout << "AC x " << cnt_ac << endl;
  cout << "WA x " << cnt_wa << endl;
  cout << "TLE x " << cnt_tle << endl;
  cout << "RE x " << cnt_re << endl;
  return 0;
}
