#include <bits/stdc++.h>
static const long long MX = 100005;
static const long long MX_ll = 1e18;
using namespace std;
int main() {
  int n;
  cin >> n;
  string s[n];
  int cnt[n];
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++) cnt[i] = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == "AC") {
      cnt[0]++;
    } else if (s[i] == "WA") {
      cnt[1]++;
    } else if (s[i] == "TLE") {
      cnt[2]++;
    } else if (s[i] == "RE") {
      cnt[3]++;
    }
  }
  cout << "AC x " << cnt[0] << endl;
  cout << "WA x " << cnt[1] << endl;
  cout << "TLE x " << cnt[2] << endl;
  cout << "RE x " << cnt[3] << endl;
}
