#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const long long INF = 10010001010;
const int inf = 1000034000;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  int N;
  cin >> N;
  vector<string> S(N);
  vector<int> J(4, 0);
  for (int i = 0; i < N; i++) {
    cin >> S[i];
    if (S[i] == "AC") {
      J[0]++;
    } else if (S[i] == "WA") {
      J[1]++;
    } else if (S[i] == "TLE") {
      J[2]++;
    } else {
      J[3]++;
    }
  }
  cout << "AC x" << J[0] << endl;
  cout << "WA x " << J[1] << endl;
  cout << "TLE x " << J[2] << endl;
  cout << "RE x " << J[3] << endl;
}
