#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int cnt1 = 0;
  long long int cnt2 = 0, cnt3 = 0, cnt4 = 0;
  for (int i = 0; i < n; i++) {
    string str;
    cin >> str;
    if (str == "AC")
      cnt1++;
    else if (str == "WA")
      cnt2++;
    else if (str == "TLE")
      cnt3++;
    else
      cnt4++;
  }
  cout << "AC*" << cnt1 << endl;
  cout << "WA*" << cnt2 << endl;
  cout << "TLE*" << cnt3 << endl;
  cout << "RE*" << cnt4 << endl;
}
