#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1000000000;
int main() {
  ll n;
  cin >> n;
  vector<string> x(n);
  ll a = 0, b = 0, c = 0, d = 0;
  for (ll i = 0; i < n; i++) {
    cin >> x[i];
    if (x[i] == "AC") {
      a++;
    }
    if (x[i] == "WA") {
      b++;
    }
    if (x[i] == "TLE") {
      c++;
    }
    if (x[i] == "RE") {
      d++;
    }
  }
  cout << "AC"
       << "x" << a << endl;
  cout << "WA"
       << "x" << b << endl;
  cout << "TLE"
       << "x" << c << endl;
  cout << "RE"
       << "x" << d << endl;
}
