#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long power(long long a, long long n) {
  long long result = 1;
  while (n > 0) {
    if (n & 1) {
      result = result * a;
    }
    a = a * a;
    n = n >> 1;
  }
  return result;
}
bool compare(string &s1, string &s2) { return s1.size() < s2.size(); }
int32_t main() {
  fast();
  long long t;
  cin >> t;
  map<string, long long> mp;
  while (t--) {
    string s;
    cin >> s;
    mp[s]++;
  }
  if (mp.find("AC") != mp.end())
    cout << "AC"
         << " x " << mp["AC"] << '\n';
  if (mp.find("WA") != mp.end())
    cout << "WA"
         << " x " << mp["WA"] << '\n';
  if (mp.find("TLE") != mp.end())
    cout << "TLE"
         << " x " << mp["TLE"] << '\n';
  if (mp.find("RE") != mp.end())
    cout << "RE"
         << " x " << mp["RE"] << '\n';
  if (mp.find("AC") == mp.end())
    cout << "AC"
         << " x " << 0 << '\n';
  if (mp.find("WA") == mp.end())
    cout << "WA"
         << " x " << 0 << '\n';
  if (mp.find("TLE") == mp.end())
    cout << "TLE"
         << " x " << 0 << '\n';
  if (mp.find("RE") == mp.end())
    cout << "RE"
         << " x " << 0 << '\n';
  return 0;
}
