#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, c = 0, c1 = 0, c2 = 0, c3 = 0, i;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    if (s[0] == 'A')
      c++;
    else if (s[0] == 'W')
      c1++;
    else if (s[0] == 'T')
      c2++;
    else
      c3++;
  }
  cout << "AC"
       << " " << c << endl;
  cout << "WA"
       << " " << c1 << endl;
  cout << "TLE"
       << " " << c2 << endl;
  cout << "RE"
       << " " << c3 << endl;
}
