#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0;
  cin >> n;
  string s;
  for (long long int i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC") cnt1++;
    if (s == "WA") cnt2++;
    if (s == "TLE") cnt3++;
    if (s == "RE") cnt4++;
  }
  cout << "AC x " << cnt1 << endl
       << "WA x " << cnt2 << endl
       << "TLE x " << cnt3 << endl
       << "RE x" << cnt4 << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
