#include <bits/stdc++.h>
using namespace std;
const long long N = 1000000007;
void solve() {
  long long n, a, b, c, ans = 0, count = 0, sum = 0;
  cin >> n;
  string arr[n];
  map<string, long long> m;
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    m[arr[i]]++;
  }
  cout << "AC x" << m["AC"] << endl;
  cout << "WA x" << m["WA"] << endl;
  cout << "TLE x" << m["TLE"] << endl;
  cout << "RE x" << m["RE"] << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  { solve(); }
  return 0;
}
