#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, b, c, p, q, x, y, z, i, j, k, ans = 0, count = 0,
                                                    flag = 0;
  long long int count1 = 0, count2 = 0, count3 = 0, count4 = 0;
  long long int a[n + 5];
  cin >> n;
  for (i = 0; i < n; i++) {
    string v;
    cin >> v;
    if (v[0] == 'A')
      count1++;
    else if (v[0] == 'W')
      count2++;
    else if (v[0] == 'T')
      count3++;
    else
      count4++;
  }
  for (i = 0; i < n; i++) {
  }
  cout << "AC"
       << " "
       << "*"
       << " " << count1 << endl;
  cout << "WA"
       << " "
       << "*"
       << " " << count2 << endl;
  cout << "TLE"
       << " "
       << "*"
       << " " << count3 << endl;
  cout << "RE"
       << " "
       << "*"
       << " " << count4 << endl;
  return 0;
}
