#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return !a ? b : gcd(b % a, a); }
int lcm(int a, int b) { return (a * b) / gcd(a, b); }
int main() {
  int t;
  cin >> t;
  int c1, c2, c3, c4;
  c1 = c2 = c3 = c4 = 0;
  while (t--) {
    string s;
    cin >> s;
    if (s == "AC")
      c1++;
    else if (s == "WA")
      c2++;
    else if (s == "TLE")
      c3++;
    else
      c4++;
  }
  cout << "AC x " << c1 << '\n';
  cout << "WA x" << c2 << '\n';
  cout << "TLE x " << c3 << '\n';
  cout << "RE x " << c4 << '\n';
}
