#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int cnt_a = 0, cnt_w = 0, cnt_t = 0, cnt_r = 0;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    if (s == "AC") cnt_a++;
    if (s == "WA") cnt_w++;
    if (s == "TLE") cnt_t++;
    if (s == "RE") cnt_r++;
  }
  cout << "AC"
       << "x" << cnt_a << endl;
  cout << "WA"
       << "x" << cnt_w << endl;
  cout << "TLE"
       << "x" << cnt_t << endl;
  cout << "RE"
       << "x" << cnt_r << endl;
}
