#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int a = 0, b = 0, c = 0, d = 0;
  for (long long int i = 0; 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 << endl;
  cout << "WA"
       << " "
       << "X"
       << " " << b << endl;
  cout << "TLE"
       << " "
       << "X"
       << " " << c << endl;
  cout << "RE"
       << " "
       << "X"
       << " " << d << endl;
  return 0;
}
