#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  long long ans = 0;
  cin >> n;
  string S;
  vector<long long> v(4, 0);
  for (long long i = 0; i < (n); i++) {
    cin >> S;
    if (S == "AC") {
      v[0]++;
    }
    if (S == "WA") {
      v[1]++;
    }
    if (S == "TLE") {
      v[2]++;
    }
    if (S == "RE") {
      v[3]++;
    }
  }
  cout << "AC x　" << v[0] << endl;
  cout << "WA x　" << v[1] << endl;
  cout << "TLE x　" << v[2] << endl;
  cout << "RE x　" << v[3] << endl;
  return 0;
}
