#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int count = 0, count1 = 0, score2 = 0, ken3 = 0;
  for (int i = 0; i < n; i++) {
    string ss;
    cin >> ss;
    if (ss == "AC") count++;
    if (ss == "WA") count1++;
    if (ss == "TLE") score2++;
    if (ss == "RE") ken3++;
    i++;
  }
  cout << "AC"
       << " "
       << "x"
       << " " << count << endl;
  cout << "WA"
       << " "
       << "x"
       << " " << count1 << endl;
  cout << "TLE"
       << " "
       << "x"
       << " " << score2 << endl;
  cout << "RE"
       << " "
       << "x"
       << " " << ken3 << endl;
}
