#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long mod = 1e9 + 7;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
long long f(long long n) { return n * (n + 1) / 2; }
int main() {
  int n;
  cin >> n;
  int a = 0, b = 0, c = 0, d = 0;
  for (int i = 0; i < (n); ++i) {
    string s;
    cin >> s;
    if (s == "AC") a++;
    if (s == "WA") b++;
    if (s == "TLE") c++;
    if (s == "RE") d++;
  }
  cout << "AC　x  ";
  cout << a << endl;
  cout << "WA  x  ";
  cout << b << endl;
  cout << "TLE  x  ";
  cout << c << endl;
  cout << "RE  x  ";
  cout << d << endl;
}
