#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int p = 0, q = 0, r = 0, s = 0;
  string a[100];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == "AC") {
      p++;
    }
    if (a[i] == "WA") {
      q++;
    }
    if (a[i] == "TLE") {
      r++;
    }
    if (a[i] == "RE") {
      s++;
    }
  }
  cout << "AC x " << p << endl;
  cout << "WA x " << q << endl;
  cout << "TLE x " << r << endl;
  cout << "RE x " << s << endl;
}
