#include <bits/stdc++.h>
using namespace std;
void getio() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void solve() {
  long long n;
  cin >> n;
  long long a = 0, b = 0, c = 0, d = 0;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") a++;
    if (s == "WA") b++;
    if (s == "TLE")
      c++;
    else
      d++;
  }
  cout << "AC x " << a << "\n";
  cout << "WA x " << b << "\n";
  cout << "TLE x " << c << "\n";
  cout << "RE x " << d << "\n";
}
int32_t main() {
  getio();
  solve();
}
