#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a = 0, b = 0, c = 0, d = 0;
  for (int i = 1; i <= n; ++i) {
    string s;
    cin >> s;
    if (s == "AC")
      a++;
    else if (s == "WA")
      b++;
    else if (s == "TLE")
      c++;
    else
      d++;
  }
  cout << "AC"
       << " "
       << "X"
       << " " << a << '\n';
  cout << "WA"
       << " "
       << "X"
       << " " << b << '\n';
  cout << "TLE"
       << " "
       << "X"
       << " " << c << '\n';
  cout << "RE"
       << " "
       << "X"
       << " " << d << '\n';
}
