#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int T, i, j, c, d, p, q, n, a, b, m;
  string s1, s2, s3, s4;
  cin >> T;
  a = b = c = d = 0;
  while (T--) {
    cin >> s1;
    if (s1 == "AC")
      a++;
    else if (s1 == "WA")
      b++;
    else if (s1 == "TLE")
      c++;
    else if (s1 == "RE")
      d++;
  }
  cout << "AC X " << a << endl;
  cout << "WA X " << b << endl;
  cout << "TLE X " << c << endl;
  cout << "RE X " << d << endl;
}
