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