#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  string s;
  map<string, long long> m;
  m["AC"] = 0;
  m["WA"] = 0;
  m["TLE"] = 0;
  m["RE"] = 0;
  while (n--) {
    cin >> s;
    m[s]++;
  }
  cout << "AC"
       << " x " << m["AC"] << endl;
  cout << "WA"
       << " x " << m["WA"] << endl;
  cout << "TLW"
       << " x " << m["TLE"] << endl;
  cout << "RE"
       << " x " << m["RE"] << endl;
}
