#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n;
  cin >> n;
  long int a = 0, w = 0, r = 0, t = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC")
      a += 1;
    else if (s == "WA")
      w += 1;
    else if (s == "TLE")
      t += 1;
    else
      r += 1;
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << w << endl;
  cout << "TLE x " << t << endl;
  cout << "RA x " << r << endl;
  return 0;
}
