#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
const long double PI = 3.14159265358979323846;
const long long MOD = 1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  srand(time(0));
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int wa = 0, tle = 0, ac = 0, re = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC")
      ac++;
    else if (s == "TLE")
      tle++;
    else if (s == "RE")
      re++;
    else
      wa++;
  }
  cout << "AC X " << ac << "\n";
  cout << "WA X " << wa << "\n";
  cout << "TLE X " << tle << "\n";
  cout << "RE X " << re << "\n";
}
