#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string st;
  int C = 0, C1 = 0, C2, C3 = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> st;
    if (st == "AC") {
      C++;
    } else if (st == "WA") {
      C1++;
    } else if (st == "TLE") {
      C2++;
    } else {
      C3++;
    }
  }
  cout << "AC x " << C << endl;
  cout << "WA x " << C1 << endl;
  cout << "TLE x " << C2 << endl;
  cout << "RE x " << C3 << endl;
}
