#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n, count1, count2, count3, count4;
  cin >> n;
  
  vector<string> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  
  count1 = 0;
  count2 = 0;
  count3 = 0;
  count4 = 0;
  for (int i = 0; i < n; i++) {
    if (vec.at(i) = "AC") count1++;
    else if (vec.at(i) = "WA") count2++;
    else if (vec.at(i) = "TLE") count3++;
    else if (vec.at(i) = "RE") count4++;
  }
  
  cout << "AC x " << count1 << endl;
  cout << "WA x " << count2 << endl;
  cout << "TLE x " << count3 << endl;
  cout << "RE x " << count4 << endl;
}
