#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, a = 0, w = 0, t = 0, r = 0;
  cin >> n;
  string s;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    if (s == "AC")
      a++;
    else if (s == "TLE")
      t++;
    else if (s == "WA")
      w++;
    else
      r++;
  }
  cout << "AC x " << a << "\nWA x " << w << "\nTLE x " << t << "\nRE x " << r;
}
