#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, j, i;
  cin >> n;
  string s;
  long long ac = 0, re = 0, tle = 0, wa = 0;
  for (i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC") ac++;
    if (s == "RE") re++;
    if (s == "TLE")
      tle++;
    else
      wa++;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
  return 0;
}
