#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long long INF = 1e18;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  long long n;
  cin >> n;
  long long data[4];
  for (long long i = 0; i < (n); i++) {
    string s;
    cin >> s;
    if (s == "AC") data[0]++;
    if (s == "WA") data[1]++;
    if (s == "TLE") data[2]++;
    if (s == "RE") data[3]++;
  }
  cout << "AC x " << data[0] << '\n';
  cout << "WA x " << data[1] << '\n';
  cout << "TLE x " << data[2] << '\n';
  cout << "RE x " << data[3] << '\n';
}
