#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  int count1 = 0, count2 = 0, count3 = 0, count4 = 0;
  while (t--) {
    string s;
    cin >> s;
    if (s == "AC") {
      count1++;
    } else if (s == "WA") {
      count2++;
    } else if (s == "TLE") {
      count3++;
    } else
      count4++;
  }
  cout << "AC "
       << "x" << count1 << endl;
  cout << "WA "
       << "x" << count2 << endl;
  cout << "TLE "
       << "x" << count3 << endl;
  cout << "RE "
       << "x" << count4 << endl;
  return 0;
}
