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