#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long ac, wa, tle, re;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") {
      ac++;
    } else if (s == "TLE") {
      tle++;
    } else if (s == "WA") {
      wa++;
    } else {
      re++;
    }
  }
  cout << "AC"
       << " x " << ac << endl;
  cout << "WA"
       << " x " << wa << endl;
  cout << "TLE"
       << " x " << tle << endl;
  cout << "RE"
       << " x " << re << endl;
}
