#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " , ";
  __f(comma + 1, args...);
}
const int MOD = 1000000007;
using PII = pair<int, int>;
using LL = long long int;
template <typename T>
void input(vector<T>& arr, LL n) {
  T temp;
  for (LL i = 0; i < n; i++) cin >> temp, arr.push_back(temp);
}
template <typename T>
void output(vector<T> arr) {
  T temp;
  for (auto x : arr) cout << x << " ";
  cout << endl;
}
template <typename T>
void input_set(set<T>& arr, LL n) {
  T temp;
  for (LL i = 0; i < n; i++) cin >> temp, arr.insert(temp);
}
LL power(LL num, LL base) {
  if (base == 0) return 1;
  if (base % 2)
    return (num % MOD * power(num, base - 1) % MOD) % MOD;
  else {
    LL x = power(num, base / 2);
    x = (x * x) % MOD;
    return x;
  }
}
int cnt[4];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  memset(cnt, 0, sizeof cnt);
  int cases;
  cin >> cases;
  while (cases--) {
    string st;
    cin >> st;
    if (st == "AC") {
      cnt[0]++;
    } else if (st == "WA") {
      cnt[1]++;
    } else if (st == "TLE") {
      cnt[2]++;
    } else {
      cnt[3]++;
    }
  }
  cout << "AC x " << cnt[0] << endl;
  cout << "WA x " << cnt[1] << endl;
  cout << "TLE x " << cnt[2] << endl;
  cout << "RE x " << cnt[3] << endl;
}
