#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const long long INF = 1LL << 60;
int N;
vector<string> S(N + 10);
int main() {
  cin >> N;
  for (int i = 0; i < (int)(N); i++) cin >> S[i];
  vector<int> C(4);
  sort(S.begin(), S.end());
  for (int i = 0; i < (int)(N); i++) {
    if (S[i] == "AC")
      C[0]++;
    else if (S[i] == "WA")
      C[1]++;
    else if (S[i] == "TLE")
      C[2]++;
    else
      C[3]++;
  }
  cout << "AC"
       << " "
       << "x"
       << " " << C[0] << endl;
  cout << "WA"
       << " "
       << "x"
       << " " << C[1] << endl;
  cout << "TLE"
       << " "
       << "x"
       << " " << C[2] << endl;
  cout << "RE"
       << " "
       << "x"
       << " " << C[3] << endl;
}
