#include <bits/stdc++.h>
using namespace std;
int ceil(int a, int m) {
  if (a % m == 0) {
    return a / m;
  } else {
    return a / m + 1;
  }
}
vector<int> sort(vector<int> arr) {
  sort(arr.begin(), arr.end());
  return arr;
}
int main() {
  char nl = '\n';
  long long n;
  cin >> n;
  int count1 = 0;
  int count2 = 0;
  int count3 = 0;
  int count4 = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC") {
      count1++;
    } else if (s == "WA") {
      count2++;
    } else if (s == "TLE") {
      count3++;
    } else {
      count4++;
    }
  }
  cout << nl << "AC "
       << "X " << count1;
  cout << nl << "WA "
       << "X " << count2;
  cout << nl << "TLE "
       << "X " << count3;
  cout << nl << "RE "
       << "X " << count4;
}
