#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e9 + 8;
const double pi = 3.14159265359;
void solve() {
  long long n;
  cin >> n;
  long long ac = 0, wa = 0, te = 0, re = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC")
      ac++;
    else if (s == "WA")
      wa++;
    else if (s == "TLE")
      te++;
    else
      re++;
  }
  cout << "AC "
       << "X " << ac << endl;
  cout << "WA "
       << "X " << wa << endl;
  cout << "TLE "
       << "X " << te << endl;
  cout << "RE "
       << "X " << re << endl;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  solve();
  cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
}
