#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int T, count1 = 0, count2 = 0, count3 = 0, count4 = 0;
  cin >> T;
  string a[T];
  while (T--) {
    cin >> a[T];
    if (a[T] == "AC") {
      count1++;
    } else if (a[T] == "WA") {
      count2++;
    } else if (a[T] == "TLE") {
      count3++;
    } else {
      count4++;
    }
  }
  cout << "AC "
       << "* " << count1 << "\n";
  cout << "WR "
       << "* " << count2 << "\n";
  cout << "TLE "
       << "* " << count3 << "\n";
  cout << "RE "
       << "* " << count4;
}
