#include <bits/stdc++.h>
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
using ll = long long;
using ull = unsigned long long;
using namespace std;
int main() {
  ll n;
  cin >> n;
  vector<ll> count(4, 0);
  for (int i = 0; i < (n); i++) {
    string s;
    cin >> s;
    if (s == "AC")
      count[0]++;
    else if (s == "TLE")
      count[2]++;
    else if (s == "WA")
      count[1]++;
    else
      count[3]++;
  }
  cout << "AC x " << count[0] << endl;
  cout << "WA x " << count[1] << endl;
  cout << "TLE x " << count[2] << endl;
  cout << "WA x " << count[3] << endl;
}
