#include <bits/stdc++.h>
using namespace std;
const unsigned long long M = 1000000007;
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long ac = 0, wa = 0, tle = 0, re = 0;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") ac++;
    if (s == "TLE") tle++;
    if (s == "WA") wa++;
    if (s == "RE") re++;
  }
  cout << "AC"
       << " "
       << "x" << ac << endl;
  cout << "WA"
       << " "
       << "x"
       << " " << wa << endl;
  cout << "WA"
       << " "
       << "x"
       << " " << tle << endl;
  cout << "RE"
       << " "
       << "x"
       << " " << re << endl;
  return 0;
}
