#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long AC = 0;
  long long WA = 0;
  long long TLE = 0;
  long long RE = 0;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC")
      AC++;
    else if (s == "WA")
      WA++;
    else if (s == "TLE")
      TLE++;
    else if (s == "RE")
      RE++;
  }
  cout << "AC x" << AC << '\n';
  cout << "WA x" << WA << '\n';
  cout << "TLE x" << TLE << '\n';
  cout << "RE x" << RE << '\n';
  return 0;
}
