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