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