#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, AC = 0, TLE = 0, WA = 0, RE = 0;
  string s;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    if (s == "AC") AC++;
    if (s == "TLE") TLE++;
    if (s == "WA") WA++;
    if (s == "RE") RE++;
  }
  cout << "AC" << ' ' << AC << endl;
  cout << "WA" << ' ' << WA << endl;
  cout << "TLE" << ' ' << TLE << endl;
  cout << "RE" << ' ' << RE << endl;
}
