#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  int a = 0, w = 0, t = 0, r = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC")
      a++;
    else if (s == "WA")
      w++;
    else if (s == "TLE")
      t++;
    else
      r++;
  }
  cout << "AC x " << a << "\n";
  cout << "WA x " << w << "\n";
  cout << "TLE x " << t << "\n";
  cout << "RE x " << r << "\n";
  return 0;
}
