#include <bits/stdc++.h>
using namespace std;
const long long int mod = 998244353;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  string s;
  int n, a = 0, b = 0, c = 0, d = 0;
  cin >> n;
  while (n--) {
    cin >> s;
    if (s == "AC")
      a++;
    else if (s == "TLE")
      b++;
    else if (s == "WA")
      c++;
    else
      d++;
  }
  cout << "AC X " << a << "\n";
  cout << "WA X " << b << "\n";
  cout << "TLE X " << c << "\n";
  cout << "RE X " << d << "\n";
  return 0;
}
