#include <bits/stdc++.h>
using namespace std;
int ans[5];
int main() {
  string str;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> str;
    if (str == "AC") ans[1]++;
    if (str == "WA") ans[2]++;
    if (str == "TLE") ans[3]++;
    if (str == "RE") ans[4]++;
  }
  cout << "AC x " << ans[1] << endl;
  cout << "WA x " << ans[2] << endl;
  cout << "TLE x " << ans[3] << endl;
  cout << "RE x " << ans[4] << endl;
  return 0;
}
