#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
long long pmp(long long x, long long n) {
  long long a = 1;
  while (n > 0) {
    if (n & 1) a = (a * x) % M;
    x = (x * x) % M;
    n = n >> 1;
  }
  return a;
}
void solve() {
  long long n;
  vector<long long> a(4, 0);
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") a[0]++;
    if (s == "WA") a[1]++;
    if (s == "TLE") a[2]++;
    if (s == "WA") a[3]++;
  }
  cout << "AC x " << a[0] << endl;
  cout << "WA x " << a[1] << endl;
  cout << "TLE x " << a[2] << endl;
  cout << "RE x " << a[3] << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
  return 0;
}
