#include <bits/stdc++.h>
using namespace std;
using p = pair<int, int>;
using P = pair<long long, long long>;
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV = vector<vector<vector<int>>>;
using VL = vector<long long>;
using VVL = vector<vector<long long>>;
using VVVL = vector<vector<vector<long long>>>;
using Graph = VV;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int a, w, t, r;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC")
      a++;
    else if (s == "WA")
      w++;
    else if (s == "TLE")
      t++;
    else if (s == "RE")
      r++;
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << w << endl;
  cout << "TLE x " << t << endl;
  cout << "RE x " << r << endl;
}
