#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int b) {
  long long int result = 1;
  while (b > 0) {
    if (b % 2 == 1) result *= a;
    a *= a;
    b /= 2;
  }
  return result;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, count = 0, count1 = 0, count2 = 0, count3 = 0;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC")
      count++;
    else if (s == "WA")
      count1++;
    else if (s == "TLE")
      count2++;
    else
      count3++;
  }
  cout << "AC"
       << " "
       << "*"
       << " " << count << "\n";
  cout << "WA"
       << " "
       << "*"
       << " " << count1 << "\n";
  cout << "TLE"
       << " "
       << "*"
       << " " << count2 << "\n";
  cout << "RE"
       << " "
       << "*"
       << " " << count3;
}
