#include <bits/stdc++.h>
using namespace std;
long long a[100005];
char c[10];
map<string, long long> mp;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long i, j, k, n, m, x, y, t;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    string s;
    cin >> s;
    mp[s]++;
  }
  cout << "AC"
       << " "
       << "*"
       << " " << mp["AC"] << endl;
  cout << "WA"
       << " "
       << "*"
       << " " << mp["WA"] << endl;
  cout << "TLE"
       << " "
       << "*"
       << " " << mp["TLE"] << endl;
  cout << "RE"
       << " "
       << "*"
       << " " << mp["RE"] << endl;
  return 0;
}
