#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const double PI = 3.14159265358979323846;
long long modpow(long long a, long long n, long long mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
vector<int> vect_yakusuu(int n) {
  vector<int> ret;
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return ret;
}
int main() {
  long long N;
  string S[10100];
  int ans[5];
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> S[i];
  }
  for (int i = 0; i < 4; i++) {
    ans[i] = 0;
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == "AC") {
      ans[0]++;
    }
    if (S[i] == "WA") {
      ans[1]++;
    }
    if (S[i] == "TLE") {
      ans[2]++;
    }
    if (S[i] == "RE") {
      ans[3]++;
    }
  }
  cout << "AC x " << ans[0] << endl;
  cout << "WA x " << ans[1] << endl;
  cout << "TLE x " << ans[2] << endl;
  cout << "RE x " << ans[3] << endl;
  cin >> ans[0];
  return 0;
}
