#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  string s;
  int ans[4];
  for (int i = 0; i < 4; i++) ans[i] = 0;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC") {
      ans[0]++;
    } else if (s == "WA") {
      ans[1]++;
    } else if (s == "TLE") {
      ans[2]++;
    } else if (s == "RE") {
      ans[3]++;
    }
  }
  cout << "AC x " << ans[0] << endl;
  cout << "WA x " << ans[0] << endl;
  cout << "TLE x 0" << ans[0] << endl;
  cout << "RE x " << ans[0] << endl;
  return 0;
}
