#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t, i;
  cin >> t;
  map<string, int> m;
  for (i = 0; i < t; i++) {
    string s;
    cin >> s;
    m[s]++;
  }
  string a = "AC", b = "WA", c = "TLE", d = "RE";
  auto it = m.find(a);
  if (it != m.end())
    cout << it->first << " * " << it->second << endl;
  else
    cout << a << " * 0\n";
  it = m.find(b);
  if (it != m.end())
    cout << it->first << " * " << it->second << endl;
  else
    cout << b << " * 0\n";
  it = m.find(c);
  if (it != m.end())
    cout << it->first << " * " << it->second << endl;
  else
    cout << c << " * 0\n";
  it = m.find(d);
  if (it != m.end())
    cout << it->first << " * " << it->second << endl;
  else
    cout << d << " * 0\n";
  return 0;
}
