#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000007;
const long long mod = 1000000007;
const double PI = 3.14159265358979323846;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int cans(bool f) {
  if (f)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
map<string, long long> mp;
int main() {
  int N;
  cin >> N;
  mp["AC"] = 0;
  mp["WA"] = 0;
  mp["TLE"] = 0;
  mp["RE"] = 0;
  for (int i = 0; i < (N); i++) {
    string s;
    cin >> s;
    mp[s]++;
  }
  printf("AC x %lld\n", mp["AC"]);
  printf("WA x %lld\n", mp["WA"]);
  printf("TLE x %lld\n", mp["TLE"]);
  printf("RE x %lld\n", mp["R"]);
}
