#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, count1 = 0, count2 = 0, count3 = 0, count4 = 0;
  cin >> n;
  while (n--) {
    string str;
    cin >> str;
    if (str == "AC") {
      count1++;
    }
    if (str == "WA") {
      count2++;
    }
    if (str == "TLE") {
      count3++;
    }
    if (str == "RE") {
      count4++;
    }
  }
  cout << "AC x " << count1 << endl;
  cout << "WA x " << count2 << endl;
  cout << "WLE x " << count3 << endl;
  cout << "RE x " << count4;
  return 0;
}
