#include <bits/stdc++.h>
using namespace std;
int main() {
  int num, accounter = 0, wacounter = 0, tlecounter = 0, recounter = 0;
  cin >> num;
  string arr[100];
  for (int i = 0; i < num; i++) {
    cin >> arr[i];
    if (arr[i] == "AC")
      accounter++;
    else if (arr[i] == "WA")
      wacounter++;
    else if (arr[i] == "TLE")
      tlecounter++;
    else if (arr[i] == "RE")
      recounter++;
  }
  cout << "AC"
       << " "
       << "x " << accounter << endl;
  cout << "WA"
       << " "
       << "x " << wacounter << endl;
  cout << "TLE"
       << " "
       << "x " << tlecounter << endl;
  cout << "RE"
       << " "
       << "x " << recounter << endl;
  return 0;
}
