#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MAX = 2147483647;
const double PI = 3.14159265358979323846;
int main() {
  int n;
  string a;
  int s[4];
  cin >> n;
  for (int i = 0; i < n; i++) {
    s[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == "AC") s[0]++;
    if (a == "WA") s[1]++;
    if (a == "TLE") s[2]++;
    if (a == "RE") s[3]++;
  }
  cout << "AC x " << s[0] << endl;
  cout << "WA x " << s[1] << endl;
  cout << "TLE x " << s[2] << endl;
  cout << "RE x " << s[3] << endl;
}
