#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[4] = {0};
  vector<string> v = {"AC", "TLE", "WA", "RE"};
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC")
      a[0]++;
    else if (s == "TLE")
      a[1]++;
    else if (s == "WA")
      a[2]++;
    else
      a[3]++;
  }
  for (long long i = 0; i < 4; i++) cout << v[i] << " x " << a[i] << endl;
  return 0;
}
