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