#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MOD = 1000000007;
ll myLongLongPow(ll base, ll times) {
  ll acc = 1;
  for (int i = 0; i < (times); i++) acc *= base;
  return acc;
}
int main() {
  int N;
  cin >> N;
  vector<string> S(N);
  for (int i = 0; i < (N); i++) cin >> S.at(i);
  vector<int> C(4, 0);
  for (int i = 0; i < (N); i++) {
    if ("AC" == S.at(i)) {
      C.at(0)++;
    } else if ("WA" == S.at(i)) {
      C.at(1)++;
    } else if ("TLE" == S.at(i)) {
      C.at(2)++;
    } else if ("TLE" == S.at(i)) {
      C.at(3)++;
    }
  }
  cout << "AC"
       << " x " << C.at(0) << endl;
  cout << "WA"
       << " x " << C.at(1) << endl;
  cout << "TLE"
       << " x " << C.at(2) << endl;
  cout << "RE"
       << " x " << C.at(3) << endl;
  return 0;
}
