#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  long long c0, c1, c2, c3 = 0;
  for (int i = 0; i < (int)(n); i++) {
    cin >> s;
    if (s == "AC")
      c0++;
    else if (s == "WA")
      c1++;
    else if (s == "TLE")
      c2++;
    else
      c3++;
  }
  cout << "AC x " << c0 << endl;
  cout << "WA x " << c1 << endl;
  cout << "TLE x " << c2 << endl;
  cout << "RE x " << c3 << endl;
  return 0;
}
