#include <bits/stdc++.h>
using namespace std;
long long int powe(long long int x, long long int n) {
  if (n == 0) return 1;
  if (n % 2 == 0)
    return powe((x % 1000000007 * x % 1000000007) % 1000000007, n / 2) %
           1000000007;
  return (x % 1000000007 *
          powe((x % 1000000007 * x % 1000000007) % 1000000007, (n - 1) / 2)) %
         1000000007;
}
long long int gcd(long long int A, long long int B) {
  if (B == 0) return A;
  return gcd(B, A % B);
}
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  string s[n];
  map<string, long long int> mm;
  mm["AC"] = mm["WA"] = mm["TLE"] = mm["RE"] = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> s[i];
    mm[s[i]]++;
  }
  cout << "AC x " << mm["AC"] << '\n';
  cout << "WA x " << mm["WA"] << '\n';
  cout << "TLE x " << mm["TLE"] << '\n';
  cout << "RE x " << mm["RE"] << '\n';
}
